mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-27 16:07:02 +00:00
Composite groups are a routing layer. The usage-side aggregation already maps their traffic to the concrete account platform via usageLogEffectivePlatformExpr, but the error aggregation read ops_error_logs.platform verbatim. Pre-routing failures on composite groups fall back to the group platform 'composite', which is never an enabled monitor v2 config platform, so those error facts were filtered out of every channel monitor v2 query and composite groups looked permanently healthy. Join groups/accounts in the error dedup CTE and resolve the effective platform the same way as the usage side: account platform first, then a real recorded platform, else 'unknown'. The window delete+rewrite recompute rewrites historical facts with the corrected key.