You must offer a shared metrics platform to 40 teams with isolation and fair use. How do you design it?
AdvancedScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → Needs tenant isolation, per-tenant limits, self-service and cost visibility.
What I'd do →
- Use a multi-tenant backend (Mimir or similar); each team is a tenant via
X-Scope-OrgID. - Collect with Alloy/Prometheus Agent per cluster, setting the tenant header based on namespace ownership.
- Set per-tenant limits:
max_global_series_per_user,ingestion_rate,max_fetched_series_per_query. - Give each team a Grafana folder and datasource scoped to its tenant; a platform tenant can query across tenants for platform views.
- Publish usage dashboards (series, samples/s, cost) per tenant and review monthly.
- Document how to request higher limits.
Why → Limits stop one team from hurting all others; visibility makes teams fix their own cardinality.
Interview tip → Mention federated querying across tenants for shared services (tenant-a|tenant-b).
More on Long-Term Storage, Scale and Cost
Prometheus keeps 15 days of data, but leadership wants 13 months of metrics for capacity planning. What do you build?IntermediateThe Thanos compactor has halted and the bucket keeps growing. What do you do?AdvancedGrafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?IntermediateRemote write to your central store is falling further behind every hour. How do you handle it?AdvancedMimir rejects writes from a team with `err-mimir-max-series-per-user`. What do you do?IntermediateYour observability SaaS bill tripled in a quarter, driven by custom metrics. How do you bring it down?Intermediate