Building Multi-Tenant Observability: Centralized Monitoring for Platform Teams

Centralized monitoring sounds simple until you run it for 40 engineering teams with conflicting SLAs, wildly different cardinality, and a habit of shipping high-cardinality labels at 2 AM. Over the last three years, my platform team has operated a multi-tenant observability platform supporting roughly 800 Kubernetes namespaces, 12,000 pods at peak, and close to 2 million active series in Prometheus-compatible storage. The central lesson is this: multi tenancy is not a feature you bolt on with a few extra labels. It is an architectural constraint that has to shape ingestion, storage, query, and access control from day one. In this article, I’ll walk through how we built centralized monitoring that actually scales for platform teams — what broke, what we changed, and the patterns I’d use again. If you are responsible for a shared observability platform, this is the operational reality behind the diagrams.

Why Centralized Monitoring Fails When Tenancy Is an Afterthought

In my experience, most platform teams start with a single Prometheus, a single Grafana, and good intentions. One team instruments their app, then five more do, then you discover that one service is emitting a histogram with 50 buckets per endpoint per pod and your head series has tripled overnight. Without tenant boundaries, you have no way to attribute cost, enforce limits, or isolate a noisy neighbor. You also have no clean way to answer the most basic platform question: who is responsible for this metric and who pays for its retention?

A centralized monitoring system without tenancy quickly becomes a tragedy of the commons. Teams either over-instrument because storage feels free, or they under-instrument because they don’t trust the platform to retain their data reliably. Both outcomes are bad. The fix is to define what a tenant is early. For us, a tenant is not a user. It’s a business-aligned ownership boundary: typically one or two Kubernetes namespaces plus associated cloud resources, tied to a team and a cost center. That tenant ID propagates everywhere — from the OpenTelemetry resource attributes to the remote-write headers, to the Cortex/Mimir tenant field, to the folder structure in Grafana.

Defining Tenant Boundaries Before Choosing Tools

Before evaluating backends, we mapped three isolation requirements: data plane isolation (one tenant cannot read another’s telemetry), control plane isolation (one tenant cannot exhaust shared resources), and operational isolation (one tenant’s outage or reconfiguration doesn’t cascade). This forced us away from a single giant Prometheus with clever RBAC and toward a gateway + distributed backend model. The gateway validates tenant identity, enforces rate limits, and routes to tenant-specific ingestion paths. Even when the underlying storage is shared, the logical boundary is explicit at the edge.

I’ve found that tying tenancy to your Internal Developer Platform: Self-Service Infrastructure for Engineering Teams pays off immediately. When a team provisions a namespace via your IDP, the observability tenant, Grafana folder, alerting namespace, and default dashboards are created atomically. If tenancy lives only in your monitoring stack, it will drift. If it lives in the platform provisioning layer, it stays consistent.

Designing Tenant-Aware Telemetry Pipelines with OpenTelemetry Collectors

The collection layer is where multi-tenant promises either hold or collapse. We run OpenTelemetry Collectors as an aggregation tier, not as sidecars everywhere. DaemonSet collectors handle node-level signals like kubelet metrics and host logs, while a stateless deployment of gateway collectors handles OTLP ingestion from applications. The critical piece is that tenant attribution happens at the gateway, not in application code.

Applications are configured to send to a regional OTLP endpoint without needing to know their tenant ID. The gateway extracts tenant identity from mTLS client certificates and from Kubernetes metadata via the k8sattributes processor. This avoids pushing tenancy concerns into hundreds of services and prevents spoofing. A workload in namespace payments-prod cannot claim to be search-prod because the gateway reconciles the presented identity against the Kubernetes API.

# Gateway OTel Collector - tenant extraction and routing
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
        auth:
          authenticator: mTLS

processors:
  k8sattributes:
    auth_type: serviceAccount
  attributes/tenant:
    actions:
      - key: tenant.id
        from_attribute: k8s.namespace.name
        action: upsert
  filter/drop_untenanted:
    logs:
      exclude:
        bodies: [".*"]
        conditions: ['attributes["tenant.id"] == nil']
  batch:
    timeout: 2s
    send_batch_size: 8192

exporters:
  prometheusremotewrite/tenanted:
    endpoint: http://mimir-gateway.monitoring.svc:8080/api/v1/push
    headers:
      X-Scope-OrgID: "${TENANT_ID}"  # set via connector routing
    retry_on_failure:
      enabled: true
      max_elapsed_time: 120s
  logging:
    loglevel: warn

connectors:
  routing/tenant:
    table:
      - statement: route() where attributes["tenant.id"] == "payments-prod"
        exporters: [prometheusremotewrite/tenanted]

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [k8sattributes, attributes/tenant, batch]
      exporters: [routing/tenant]
    metrics:
      receivers: [otlp]
      processors: [k8sattributes, attributes/tenant, batch]
      exporters: [routing/tenant]

We also use tail-based sampling at the gateway, but sampling decisions must be tenant-aware. A global 5% sample rate destroys low-throughput critical services while still over-sampling high-volume chatty ones. Our sampling policies are configured per tenant with overrides for critical traces (e.g., keep 100% of traces where http.status_code >= 500 or tenant.id == "payments-prod" and duration > 2s). This keeps costs predictable without blinding teams that need full fidelity for their most important flows.

Handling Logs and Traces Under the Same Tenancy Model

Metrics get the most attention, but logs will break your isolation first. A single team shipping unstructured JSON logs at 50k lines per second can saturate your Loki or Elasticsearch ingestion. We apply the same tenant header model to logs and enforce per-tenant ingestion limits at the distributor. For traces, the challenge is cardinality in the opposite direction: teams that add user_id or request_id as span attributes and then wonder why their Tempo queries time out. The collector’s attributes processor is configured with an explicit allowlist per signal type, and disallowed high-cardinality keys are dropped or hashed at the edge.

Enforcing Cardinality Control and Data Isolation at the Storage Layer

Storage is where centralized monitoring for multi-tenant environments becomes an economics problem. In a shared Prometheus or Mimir/Cortex cluster, a single tenant can create operational risk for everyone through cardinality explosion. We have had incidents where a team added customer_id as a Prometheus label, generated 600k new series in 20 minutes, and triggered OOMKills across ingesters.

The fix is not just documentation. You need automated guardrails. We run Mimir in microservices mode with per-tenant overrides that are applied at the distributor and ingester. Every tenant gets a default limit — for example, 150k active series, 50k samples per second, 100k exemplars — and teams can request increases via a platform PR workflow that triggers a capacity review. Limits are not advisory; they are enforced with 429 responses and visible in Grafana as mimir_distributor_rejected_samples_total{reason="max_series_per_user"} so teams can self-diagnose.

# Mimir runtime overrides - per-tenant cardinality controls
overrides:
  payments-prod:
    ingestion_rate: 75000
    ingestion_burst_size: 150000
    max_global_series_per_user: 250000
    max_label_names_per_series: 30
    max_label_value_length: 2048
    max_global_exemplars_per_user: 200000
    ruler_max_rules_per_rule_group: 50
    ruler_max_rule_groups_per_tenant: 20

  search-prod:
    ingestion_rate: 120000
    ingestion_burst_size: 200000
    max_global_series_per_user: 400000
    compactor_blocks_retention_period: 90d

# Applied via runtime-config ConfigMap, reloaded without restart
# See: https://grafana.com/docs/mimir/latest/configure/about-tenant-ids/

Isolation also means query isolation. Even with shared ingesters and stores, a heavy query from one tenant should not starve others. Mimir’s query-frontend and query-scheduler enforce per-tenant query limits: max query lookback, max query length, and max outstanding queries. We also separate read and write paths at the network policy level. In Kubernetes, this maps to distinct NetworkPolicies and resource quotas for the monitoring namespace, as described in the Kubernetes Documentation on resource management. In my experience, setting requests.memory equal to limits.memory for ingesters and store-gateways reduces noisy neighbor scheduling jitter significantly.

For long-term retention, we use object storage with tenant-prefixed paths and separate compactor jobs per tenant pool. Compaction and retention are not global settings; search can keep 90 days of high-resolution metrics while a batch job tenant keeps 7 days. This aligns cost with value and makes chargeback defensible.

Modeling Tenancy in Prometheus and Thanos Without Label Explosion

If you are still running Prometheus in agent mode and centralizing with Thanos or Mimir, the temptation is to add a tenant="team-a" label to every series and call it tenancy. I’ve tried that. It works until you need to run PromQL that aggregates across tenants or you hit label value limits. A better approach is to keep tenant identity out of the metric labels and in the system metadata.

In our Thanos-era setup, each tenant had a dedicated Prometheus agent (running in agent mode) with remote_write to a central receiver that injected the X-Scope-OrgID header. The metric itself had no tenant label; the tenant was a property of the write path. This kept PromQL clean and avoided the classic mistake of filtering {tenant="x"} in every query and alert. For federated queries, Thanos Query used the tenant header to isolate store APIs, so a query for team-a only touched blocks and WAL for that tenant.

# Prometheus agent - tenant-aware remote_write (no tenant label on series)
global:
  scrape_interval: 30s
  external_labels:
    cluster: prod-us-central1
    replica: a  # do NOT add tenant here

remote_write:
  - url: https://observability.example.com/api/v1/push
    headers:
      X-Scope-OrgID: payments-prod
    queue_config:
      capacity: 8000
      max_shards: 200
      min_backoff: 100ms
      max_backoff: 5s
    write_relabel_configs:
      # Drop high-cardinality labels before remote write
      - regex: customer_id|request_id|user_id
        action: labeldrop
      # Keep only what you actually alert on
      - source_labels: [__name__]
        regex: go_.*|process_.*
        action: drop

scrape_configs:
  - job_name: kubernetes-pods
    kubernetes_sd_configs:
      - role: pod
    relabel_configs:
      - source_labels: [__meta_kubernetes_namespace]
        target_label: namespace
      - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
        action: keep
        regex: true

The write_relabel_configs step is non-negotiable for a multi-tenant platform. We maintain a shared deny-list of labels that are never allowed to be remote-written, and we lint it in CI. Teams that need high-cardinality identifiers must use exemplars or traces, not metric labels. This single policy reduced our global active series by 38% after enforcement.

Alerting and Recording Rules as Tenant-Scoped Artifacts

Alerting is another place where tenancy must be explicit. We run Mimir ruler / Prometheus ruler with tenant-isolated rule groups. Each tenant’s rules are stored in object storage under their prefix and evaluated with their tenant context, so an alert expr: sum(rate(http_requests_total{status=~"5.."}[5m])) > 10 only sees that tenant’s data. Alertmanager is also multi-tenant: we use a single cluster with tenant-routed receivers, so alerts from payments-prod never land in search-prod’s Slack channel even if someone misconfigures a label matcher. Rule validation happens in CI via promtool check rules and mimirtool rules check before any change reaches production.

Building Chargeback, Quotas and Noisy-Neighbor Protections into the Platform

A platform without cost attribution is just a shared expense that grows until finance asks uncomfortable questions. We export three signals for chargeback: samples ingested per tenant per hour, active series per tenant, and bytes stored per tenant. All three are needed because a tenant with moderate series but aggressive scrape intervals can still dominate ingestion, while a tenant with high series but low churn dominates memory.

These metrics come directly from Mimir distributor and ingester exposures: cortex_distributor_received_samples_total, cortex_ingester_memory_series, and compactor’s cortex_bucket_blocks_used_bytes labeled by tenant. A nightly job aggregates them into a BigQuery table that feeds a cost dashboard. Teams see their observability spend trending alongside their CPU and storage spend. In my experience, visibility alone reduces waste by 20-30% — teams voluntarily drop unused metrics when they realize they are paying for them.

Quotas are enforced at two levels. Soft quotas trigger alerts to the owning team and the platform channel; hard quotas reject writes. We deliberately set soft quotas at 80% of hard limits so teams have time to react. When a tenant hits a hard limit, the error is surfaced in their own Grafana datasource health check, not buried in a platform log. This self-service feedback loop is far more effective than a ticket from the platform team.

Platform Pattern Isolation Guarantee Operational Cost When to Choose It
Shared Mimir/Cortex with per-tenant overrides Logical only; shared ingesters and compactor Lowest; efficient bin-packing 50+ tenants, cost-sensitive, strong automation
Thanos with per-tenant Prometheus agents Strong write isolation; shared query Medium; more agents to operate Migration from existing Prometheus fleets
Dedicated Prometheus + Grafana per tenant Full physical isolation Highest; duplication of all components <10 tenants with strict compliance requirements
OTel Gateway + multi-backend routing Logical with protocol-level enforcement Medium; gateway is critical path Mixed signals (metrics, logs, traces) and heterogeneous tenants

Noisy-neighbor protection also means query governance. We set per-tenant defaults: max query time range 7 days in Grafana, max samples per query 50M, and concurrency limit of 10 concurrent queries. Power users can request a higher tier, but it requires an architecture review. This prevents the classic 90-day rate() query that fans out across 6 months of blocks and OOMs the querier. We also use recording rules aggressively to pre-aggregate common dashboards — the 10 dashboards everyone opens should not trigger ad-hoc range queries.

Exposing Observability as Self-Service Without Giving Everyone Admin

The goal of centralized monitoring is not centralization for its own sake. It is to reduce the operational burden on product teams while keeping the platform team from becoming a bottleneck. Self-service is how you achieve that, but it has to be opinionated. Un fettered Grafana admin for every team leads to 400 datasources, 900 alert channels, and dashboards that query 90 days of raw data.

Our model is to provision Grafana via code. Each tenant gets a folder, a Mimir datasource scoped to their tenant ID via datasource provisioning with the X-Scope-OrgID header, and a set of reference dashboards that are known to be efficient. Teams can create dashboards inside their folder but cannot edit the provisioned datasource or create datasources that point at another tenant’s data. Dashboard JSON is stored in Git and deployed via Grafana’s provisioning sidecar; direct UI edits are disabled in production and allowed only in a dev Grafana. This keeps drift low and makes peer review possible.

For alerting, we expose a simplified abstraction. Teams don’t write raw PrometheusRule YAML if they don’t want to. They fill a small CRD or a templated form that generates validated rules. For example, a service SLO template creates an SLI recording rule, an error-budget burn alert, and a runbook link with one PR. This is one of the Golden Paths: Reducing Cognitive Load for Development Teams we maintain — an opinionated workflow that handles tenancy, naming, and best practices automatically while still allowing raw PromQL for advanced teams. In my experience, 70% of teams stay on the golden path, which dramatically reduces support load.

Access control ties this together. We use Grafana’s team sync with our IdP and map OIDC groups to tenant roles. A user in team-payments gets Viewer on payments-prod and Editor on payments-staging, but no access to risk-prod. For API access, we issue per-tenant Grafana service accounts and Mimir API tokens with short TTLs via our secrets workflow. That workflow integrates with Secrets Management: HashiCorp Vault, External Secrets and SOPS so tokens never live in plain YAML. The Terraform Documentation is useful here if you manage Grafana folders, datasources, and service accounts as code — which you should.

Finally, make your platform’s health observable to tenants. We publish a platform status dashboard that shows per-tenant ingestion health, dropped samples, query latency, and any active rate limiting. When a team opens a ticket saying “metrics are missing,” they can immediately see whether it’s a collector issue on their side or a limit they hit. Transparency reduces the trust deficit that often kills centralized platforms. If teams can’t see how the platform is treating their data, they will build shadow Prometheus instances, and you are back to square one.

Building multi-tenant observability is not about picking the perfect backend. It is about consistently enforcing tenant identity, protecting the shared infrastructure from cardinality and query abuse, and exposing the system in a way that product teams can actually use without needing to understand Cortex ring membership. Start with the tenant model, automate the guardrails, and treat self-service as a product — not a permission bit.

Frequently Asked Questions

How do you prevent one tenant's high cardinality from affecting others on a shared Mimir cluster?

Enforce per-tenant overrides at the distributor for ingestion rate, burst size, and max global series per user, and monitor distributor rejections per tenant. Combine this with write-time relabeling to drop disallowed labels like user_id and with per-tenant query limits at the query-frontend. In my experience, hard limits with 429 responses plus alerting at 80% of the limit is more effective than documentation alone.

Should I use a separate Prometheus per tenant or a shared multi-tenant backend?

For platform teams supporting more than 10-15 tenants, a shared backend like Mimir or Cortex with logical isolation is far more efficient to operate. Dedicated Prometheus per tenant gives the strongest isolation but multiplies operational cost and makes cross-tenant aggregation difficult. I recommend tenant-specific Prometheus agents for collection with a shared backend for storage and query, unless you have hard compliance requirements for physical isolation.

Where should tenant identity be injected — in the application or at the collector gateway?

At the collector gateway. Applications should send to a generic OTLP endpoint and the gateway should resolve tenant identity from mTLS certificates or Kubernetes metadata like namespace labels. This prevents spoofing, keeps application code free of platform concerns, and gives you a single enforcement point for allowlists, sampling policies, and header injection like X-Scope-OrgID.

How do you handle logs and traces in the same multi-tenant observability platform?

Apply the same tenant header model across all signals but tune limits per signal type. Logs need aggressive per-tenant ingestion byte limits because volume spikes are common, while traces need strict attribute allowlists to prevent high-cardinality span attributes. Use the OpenTelemetry Collector's filter and attributes processors to drop or hash disallowed keys at the edge, and route each signal to its tenant-isolated backend pool.

Related Articles

References & Standards: Kubernetes Documentation · Docker Documentation · Terraform Documentation