3. Isolating: multi-tenancy #
A label scope per user and per group.
The rule #
Administration → Multi-tenant menu: choose the OpenTelemetry attributes that tell tenants apart (per tenant: tenant.id; per tenant and environment: tenant.id + deployment.environment.name; or a custom list). In Prometheus and Loki, tenant.id becomes the tenant_id label.
TENANCY_ENABLED=true
TENANCY_KEYS=tenant.id,deployment.environment.namePolicies #
Each user or group carries a policy of conditions (=, !=, =~, !~) combined with AND or OR. The effective scope is the union of the user's policy and their groups' policies.
Group acme-ops : tenant.id = "acme" AND deployment.environment.name =~ "prod|preprod"
User bob : tenant.id = "globex"
=> bob, member of acme-ops, sees (acme and prod|preprod) or (globex)How it is enforced #
| Source | Mechanism |
|---|---|
| Prometheus, Mimir, Thanos, VictoriaMetrics | matchers injected into every PromQL selector |
| Loki | matchers injected into every LogQL selector |
| Elasticsearch, OpenSearch | boolean filter on tenant fields |
| Other sources | denied to restricted users, unless declared shared |
| Alerts, silences, SLOs, incidents | filtered by labels; created with the tenant labels |
Common mistake : Without a policy, the default access applies: choosenone(recommended). Withall, a new user synced from the directory sees every customer.
Good to know : The funnel in the top bar narrows the view within the allowed scope; it never widens it.
Sources #
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Advanced OpenSearch security: authentication, roles and audit
Securing OpenSearch in depth: transport and API TLS, internal, LDAP, OpenID Connect and SAML auth...
Grafana administration and security: organizations, teams, RBAC, service accounts and authentication
Running Grafana in a company: organizations, teams, folders, roles and RBAC, data source permissi...
Running Loki in production: multi-tenancy, limits, cardinality and monitoring
Operate Loki: multi-tenancy, per-tenant limits, protection against cardinality, diagnostics, moni...
Thanos Receive: ingesting remote write and handling multi-tenancy
Use Thanos Receive: push mode with remote write, hashring, replication, multi-tenancy, Prometheus...
Mimir: multi-tenancy, limits and runtime configuration
Isolate teams in Mimir: tenants and the X-Scope-OrgID header, gateway authentication, ingestion a...
VictoriaMetrics cluster: vminsert, vmselect, vmstorage and multi-tenancy
The VictoriaMetrics cluster architecture: the roles of vminsert, vmselect and vmstorage, data dis...
Administering Kibana: spaces, roles, users and monitoring
Organize Kibana for several teams: spaces, roles and privileges on indices and features, users an...
Installing Observa: Docker Compose, Kubernetes and configuration
Deploy Observa in two minutes with Docker Compose, in production on Kubernetes with Helm, then co...
Alerting in Observa: rules, notifications, built-in alerts, SLA and Sigma
Write alert rules in Prometheus format, route notifications in Alertmanager format, enable the 1,...