Documentation
¶
Overview ¶
Package metrics is the fleet SaaS-operations god-view (/v1/admin/metrics) — the operator's business dashboard: MRR/ARR, net-new vs churned MRR, the plan/category mix, the top customers, and the recent subscription movements. SuperAdmin only (core.Guard).
It OWNS no aggregation. The whole snapshot is computed IN commerce (the system of record for subscriptions + the usage ledger) by its cross-org SaaS-metrics engine (GET /v1/metrics/saas), which admin PROXIES with the SAME admin-scoped S2S service token finance uses for COGS. The engine is ALREADY fleet-wide — it walks every org namespace itself — so this is a SINGLE upstream read, no per-org fan-out, exactly as finance consumes commerce Costs. An unwired or unreachable commerce degrades to an honest empty snapshot (real zeros, `[]` not null) with a not-ok source, never a fabricated number.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MetricsData ¶
type MetricsData struct {
commerce.SaaSMetrics
GeneratedAt string `json:"generatedAt"`
Sources []core.SourceStatus `json:"sources"`
}
MetricsData is the GET /v1/admin/metrics payload: the commerce SaaS snapshot, flat, plus the admin read time and the upstream freshness strip every god-view carries.