Per-tenant read access to Prometheus with prom-label-proxy

prom-label-proxy forces a tenant label onto Prometheus reads so teams see only their own series, but it does not authenticate users or isolate writes. This page covers the pairing, the gaps and the alternatives.

On this page

Why teams need per-tenant read access to Prometheus

Several teams or customers often need to query their own metrics on one shared Prometheus, but Prometheus itself has no concept of who is asking. Every user who can reach the query API sees every series. prom-label-proxy closes that gap for reads by enforcing a fixed label, such as a tenant or team label, on the PromQL queries it forwards, on the responses returned by the Prometheus API, and on Alertmanager API requests. It does not authenticate anyone and does not authorize anyone. It only rewrites what a caller is allowed to ask for, so it must sit behind an authenticating proxy such as kube-rbac-proxy, which the project names as an example companion, or a reverse proxy that performs SSO. Identity, group mapping and the decision of which label value a user may see all stay with that front layer.

The choice between one shared Prometheus with enforced labels and a separate Prometheus per tenant depends on how strongly the tenants must be separated and how many there are. Separate servers give each team its own storage, retention, memory limits and failure domain, at the cost of more instances to run, upgrade and back up. A shared server with a label proxy is lighter to operate, but it concentrates load and cardinality risk on one system, and a single misconfigured query path can expose data if the front layer is weak. Confirm which label scheme your teams will use, whether alert rules must also be filtered, and whether customers, not just internal teams, will hold the credentials. Those answers decide whether the label proxy is enough.

The Apache-2.0 license for Prometheus and for prom-label-proxy means there is no license fee to pay for either component. The recurring costs are the infrastructure that stores and queries the metrics, the engineering time to configure and test the authentication layer, and the people who operate and upgrade both. Ask any implementation partner to price the authentication integration, the label mapping, the testing of isolation and the ongoing upgrades separately, so you can see which costs grow with the number of tenants and which stay fixed.

How a tenant query reaches Prometheus through the proxy stack

The request starts with a user who signs in to an authenticating reverse proxy, such as kube-rbac-proxy, which establishes identity. The proxy forwards the query to prom-label-proxy, which adds the tenant label to every PromQL query, Prometheus API call or Alertmanager request before Prometheus answers. Check the trust boundary: prom-label-proxy performs no authentication itself, so the proxy must be the only path to it and must reject unauthenticated traffic. Alertmanager is reached through the same enforcement path, not directly.

Authentication happens before the tenant label is enforced on every read path.

Choosing how to deploy read isolation

This table compares four ways to give teams or customers read access to only their own metrics. Read each row against your tenancy count, your write-side trust model and the number of people who will operate the stack. The main takeaway is that prom-label-proxy only narrows queries, so the write path and the authentication layer still need their own controls.

OptionWhen it fitsWhat it isolates on readWhat it leaves open on writeOperational load
prom-label-proxy behind an authenticating proxyA small number of internal teams sharing one Prometheus, where the platform team controls scrape configurationQueries, Prometheus API responses and Alertmanager API requests are forced to the tenant's label value, but only if the proxy in front enforces identityA tenant that controls scrape relabeling or a target scraped with honor_labels can write series carrying another tenant's labelsLow to moderate: one proxy, one label mapping and an identity provider integration to maintain
Separate Prometheus per tenantTenants with strict trust boundaries, separate retention needs or separate failure domainsEach tenant has its own server, so cross-tenant reads are not possible through the query pathWrites stay inside each server's own scrape scope, so cross-tenant pollution is limited to what that tenant's targets emitHigh: one server, one set of alert rules and one backup routine per tenant, multiplied by tenant count
Thanos or Grafana Mimir tenancyMany tenants that need one query endpoint, long-term storage and tenant-scoped limitsTenancy is enforced by the store and query layer using tenant identifiers, which requires confirming the exact mechanism in the chosen productConfirm how each product assigns tenant IDs on remote write and whether untrusted senders can set themHigh: a distributed system with object storage, components to size and upgrades to plan
Direct Grafana data source per teamTrusted internal users who need dashboards only and accept that Grafana is the access control pointOnly what Grafana's data source and folder permissions allow, which is not a Prometheus-level filterNot addressed: this option controls reads only and leaves Prometheus write behavior unchangedLow: few components, but permission drift in Grafana needs periodic review

Setting up prom-label-proxy in front of Prometheus

This sequence turns a shared Prometheus into one where each tenant reads only the series carrying its own label value. It covers the label scheme, an authenticating TLS proxy, prom-label-proxy enforcing the label, client routing and a cross-tenant test before any tenant is onboarded.

  1. Confirm the label scheme and API surfaces

    Decide the tenant label name (for example, a label such as tenant), the set of tenant values, and who assigns them. List every surface tenants will use: the query API, the Prometheus web UI, Grafana data sources, and Alertmanager if tenants manage their own silences or routes. Each surface must go through the enforcing proxy, or a tenant can read around it. Done when you have a written list of surfaces and a rule for where the tenant label comes from on every series (for example, from scrape configuration owned by the platform team, not by tenants). Confirm this with your own environment, since prom-label-proxy only enforces the label it is given.

  2. Place an authenticating proxy with TLS in front

    prom-label-proxy performs no authentication or authorization itself, so put a separate authenticating proxy in front of it. Options include a reverse proxy with OIDC or client certificate checks, or a companion such as kube-rbac-proxy, which the project names as an example. Terminate TLS at this layer and keep Prometheus itself off any tenant-facing network. Check that an unauthenticated request is refused, that an authenticated request reaches the next hop, and that the identity the proxy passes on cannot be set by the client.

  3. Run prom-label-proxy against Prometheus

    Start prom-label-proxy with its upstream set to your Prometheus address and the tenant label name you confirmed in the first step. Bind it to an internal address reachable only from the authenticating proxy. Confirm the flags and their current behavior against the project's repository before you configure them, because option names can change between releases. Check that a query sent through the proxy with a tenant value returns only series carrying that value, and that the proxy logs or rejects requests it cannot rewrite.

  4. Map identities to tenant label values

    Connect each authenticated identity to exactly one permitted tenant value in the authenticating layer, typically from group claims or certificate attributes. Keep this mapping in version control so changes are reviewed. Verify it with two test identities: each should see only its own tenant, and an identity with no mapping should see nothing. The check is a short list of identity-to-tenant pairs you can show an auditor or a security reviewer.

  5. Route Grafana and API clients through the proxy

    Point Grafana data sources and any scripts or API clients at the authenticating proxy instead of Prometheus. Remove direct Prometheus addresses from client configuration and from shared dashboards. Test the Prometheus web UI path as well, or restrict it to platform administrators. Done when each client returns data for its tenant and a direct request to the Prometheus address from a tenant network fails at the network layer.

  6. Set up the Alertmanager path if tenants use it

    If tenants view or manage alerts or silences through the API, route those requests through prom-label-proxy in its Alertmanager mode so the tenant label is enforced there too. Alertmanager's own routing and receivers stay under platform control. Confirm that a tenant can list only its own alerts and silences, and that a silence created by one tenant does not hide another tenant's alerts. If your deployment does not expose Alertmanager to tenants, record that decision and check that the Alertmanager address is unreachable from tenant networks.

  7. Verify with a test tenant and cross-tenant queries

    Create a test tenant with its own label value and a few known series. From its identity, query for series belonging to other tenants by name, by regex, by absent label, and through the query API, and confirm that each returns no results. Repeat from a second tenant and from an unmapped identity. Keep the test queries and their expected output as a repeatable check, and rerun them after each change to the proxy, Prometheus or the authenticating layer. Remember that this verifies read isolation only, since prom-label-proxy does not stop a tenant from writing series that appear under other labels through scrape relabeling or honor_labels.

Security gaps to close before tenants log in

prom-label-proxy only rewrites queries. It does not check who is asking, so the controls around it decide whether a tenant sees only its own series. The cards below cover the gaps that remain once the label enforcement is in place.

No authentication in the proxy

prom-label-proxy performs no authentication or authorization itself. It injects a label matcher into each query it receives, so it trusts whatever identity arrives in front of it. Place an authenticating proxy such as kube-rbac-proxy, or an SSO-aware reverse proxy, in front of it, and confirm which header or token carries the tenant identity. Test with an account from one tenant and check that it cannot reach another tenant's label value.

prom-label-proxy repository

Bypass through direct Prometheus access

If any client can reach Prometheus directly, the label enforcement is optional and any tenant can query every series. Bind Prometheus to a private interface, restrict its port with network policy or firewall rules, and allow only the proxy to connect. Verify from a tenant network segment that direct requests to the Prometheus port fail, including from pods or hosts that share the cluster network.

TLS on every hop

Tenant credentials and query results travel over HTTP between the browser, the authenticating proxy, prom-label-proxy and Prometheus. Prometheus supports TLS with TLS 1.2 as the minimum, and basic authentication without TLS exposes credentials in cleartext. Terminate TLS at each listener that carries tenant traffic, and confirm the certificate chain is valid for every internal hostname the proxy uses.

Admin and lifecycle APIs stay disabled

Tenant-facing paths must never expose the admin HTTP APIs. These are disabled by default, and --web.enable-admin-api allows destructive operations such as series deletion and snapshots, while --web.enable-lifecycle allows reload and shutdown. Confirm neither flag is set on the instance behind the proxy, and make the proxy return errors for any path other than the query endpoints tenants need.

CSRF exposure on mutating endpoints

Prometheus has no built-in CSRF protection on mutating endpoints, so a logged-in tenant's browser could be tricked into sending a request that changes server state. Limit the proxy to read-only HTTP methods for tenant traffic, and require a custom header or token check in the authenticating layer. Test by submitting a cross-site form against a logged-in session and confirming the request is refused.

What prom-label-proxy does not isolate on write

prom-label-proxy only filters what tenants read. It does not stop a tenant from writing samples that land under another tenant's label values. If a tenant controls its own scrape configuration, it can attach relabeling rules that rewrite or add labels, and a target scraped with honor_labels set to true can supply labels that Prometheus keeps instead of overwriting. In both cases, series that appear to belong to one team can carry the identifiers another team's queries depend on, and the proxy will faithfully show them to the wrong reader only if the label it enforces was also attached to those series. Before you promise isolation, trace where the enforced label is set for every scrape job and confirm that no tenant can override it.

Close the gap at ingestion, not in the query layer. Keep scrape_configs under central control, so platform engineers own the jobs, relabeling rules and service discovery selectors that decide which targets exist and which labels they carry. Where a tenant's targets must be scraped, set the tenant label in relabeling that the tenant cannot edit, and use metric_relabel_configs to drop or overwrite any label that a tenant is not allowed to set. Leave honor_labels off unless you have a specific reason to enable it, and review every job that turns it on. Restrict who can change target definitions, including ServiceMonitor or similar objects if you run Kubernetes, through the same change control you apply to the Prometheus configuration itself.

Read filtering does not change what gets written, so the write path needs its own review and its own evidence. Ask the team that operates Prometheus to show, for each tenant, the jobs that write its data, who can change them, and what happens to a label that a target tries to override. Confirm this with a test: scrape a target that emits a conflicting tenant label and check the stored series. Multi-tenant write isolation is a separate design problem, and the tenancy options covered later on this page handle it differently from a read-side proxy.

Limits to confirm in your environment

prom-label-proxy enforces a tenant label on reads, but whether that holds in your estate depends on how labels are named, how identities arrive and which Prometheus line you run. The cards below are the checks to complete before tenants receive credentials.

Label cardinality and naming scheme

The tenant label must be present and consistent on every series a tenant should see. Check whether your teams already use a label such as team or tenant, whether any series lack it, and how many distinct tenant values you expect. Each new tenant value adds series, so agree the label name and its allowed values before onboarding. Confirm the label set with your Prometheus administrators before any tenant is provisioned.

Tenant identity from SSO groups

The proxy does not authenticate anyone, so the tenant value must come from an identity layer in front of it. Map each SSO group to exactly one tenant value and confirm that a user cannot belong to a group that grants a broader value. Decide how the proxy receives that value, such as a trusted header from the authenticating proxy, and confirm that clients cannot set that header themselves.

prom-label-proxy repository

Regex and matcher bypass cases

Test how the proxy handles queries that try to widen results, including regex matchers, negative matchers, or expressions, subqueries and label manipulation functions. Your test set should include a query that names another tenant's value and a query that omits the label entirely. Run these as tenant credentials, not as an administrator, and record each result before you accept the design.

Prometheus version against the LTS line

Confirm which Prometheus version your proxy path has been tested against before you pin it. The current LTS line is 3.13, which receives bug fixes until July 31, 2027, and a minor release generally stops receiving fixes after six weeks. Plan the upgrade path for the proxy and Prometheus together so tenant enforcement is retested after every change.

Release cycle page

Tenant view of alerts and silences

Alert rules and silences are often global, so a tenant may see alerts for systems it does not own, or be unable to silence its own alerts. Confirm whether the proxy path you choose also covers Alertmanager API requests, and whether tenants should see rules, firing alerts and silences scoped to their label. Agree who creates and edits rules for each tenant before granting any write access.

Questions buyers ask about per-tenant Prometheus access

Can prom-label-proxy be used alone to isolate tenants?

No. prom-label-proxy enforces a given label on PromQL queries, Prometheus API responses and Alertmanager API requests, but it performs no authentication or authorization itself. You need an authenticating layer in front of it that establishes who the caller is and which tenant they belong to. The project's own documentation names kube-rbac-proxy as an example companion. Your team or a partner has to decide how identity maps to the enforced label value, how tokens or certificates are issued, and how the proxy is placed so that users cannot reach Prometheus directly and bypass it. Without that front layer, the label enforcement protects nothing, because any caller can choose the label value they send.

Does prom-label-proxy stop tenants from writing other tenants' metrics?

No. prom-label-proxy is a read control only. A tenant that controls its own scrape relabeling, or a target scraped with honor_labels enabled, can write series that carry another tenant's labels and pollute that tenant's data. Write isolation has to come from the operator's side: scrape configurations owned by the platform team, relabeling rules that the tenant cannot edit, and no honor_labels on targets a tenant can influence. If tenants can deploy their own scrape jobs or exporters, treat each write path as a separate design decision and review it before granting access.

When should we choose Thanos or Mimir tenancy instead?

Choose a tenancy-aware long-term store such as Thanos or Grafana Mimir when you need isolation on both write and read, when data must outlive a single Prometheus server, or when the number of tenants and volume of series make one server a bottleneck. Those systems carry tenant identity through ingestion and storage, which prom-label-proxy does not do. The trade-off is operational weight: more components, object storage, and a retention and compaction model to run. A simpler per-tenant read layer on one Prometheus can be enough when the tenant count is small, the data stays on one server, and the platform team controls every scrape target. Confirm each product's current tenancy features in its own documentation before deciding.

How much effort and time does the setup need, and what drives it?

The effort depends on the identity model, the number of tenants and the write paths you need to control. Work usually includes mapping identities to tenant label values, placing the proxy and the authenticating layer, writing and testing query access rules, checking that direct access to Prometheus is blocked, and reviewing scrape configuration ownership. Prometheus local storage holds data for 15 days by default, and retention is configurable by time or size, so that setting also shapes what each tenant can see over time. No duration figure is supplied for this work, so ask any provider for a fixed-scope estimate based on your tenant count, identity provider and scrape layout, and confirm it against a written scope.

What does the work need from our team?

Expect to supply the people who own identity, the platform team that owns Prometheus and its scrape configuration, and a named owner for tenant onboarding. Identity staff provide the group or claim model that decides tenant membership. Platform staff provide access to the Prometheus server, the reverse proxy or ingress, and the configuration repository. Security or compliance staff should review the access matrix and test results. Ask whether the provider needs test tenants, sample queries from real dashboards, and a change window for routing traffic through the proxy. Confirm who approves access changes after handover.

Can we run per-tenant read access ourselves without a partner?

Yes, if your team already runs Prometheus behind an authenticating proxy and is comfortable reading the project's documentation, testing label enforcement, and maintaining the configuration. The parts that most often go wrong are not the proxy itself: they are identity mapping gaps, direct access paths left open, and scrape configurations that tenants can influence. A partner can add value through a fixed-scope review, an independent test of bypass paths and write isolation, and handover documentation. DeployOpen implements and hardens open-source platforms in infrastructure you control and runs security testing, so it can be scoped either to build the setup or to test one you already run.

Where should we verify the setup before giving tenants access?

Start with the project repository, which documents the supported query and API paths and the limits of label enforcement. Then test from the tenant side: confirm that every query a tenant can send is rewritten to its own label value, that requests with another tenant's value are refused, and that direct requests to Prometheus, its admin endpoints and its Alertmanager API are blocked. Check the Prometheus security model for admin and lifecycle API exposure, and review the Prometheus storage documentation for how retention affects what each tenant sees over time. Repeat these tests after every upgrade of the proxy or Prometheus.

When Thanos or Mimir tenancy is the better answer

Choose a long-term store with native tenancy when prom-label-proxy cannot carry the whole isolation requirement. Prometheus local storage is single-node and not clustered or replicated, so it holds one copy of each sample on one server. Remote write and remote read let Prometheus forward samples to, and query them from, external long-term storage systems such as Thanos or Grafana Mimir. Those systems are built to hold data for many tenants, and they can separate tenants on both the write path and the read path, which a read-side label filter cannot do. If your tenants run their own scrape configurations, or if you need a copy of the data that survives the loss of a single Prometheus server, this is the design to evaluate.

The trade-off is operational. Thanos and Mimir each run several components, including ingesters, stores, queriers or compactors, object storage and their own upgrade and capacity planning, so the team that runs them carries a larger footprint than a single Prometheus with a proxy in front. Ask the partner or internal team to estimate that footprint in the written scope, and ask which tenant identifiers are enforced at ingestion, at query time and in the admin APIs. Confirm each project's tenancy behavior against its current documentation before you commit, because the features, limits and configuration keys change between releases.

Use this check before you decide. Write down who writes metrics, who reads them and whether any tenant can influence labels on scraped series. If write isolation is a hard requirement, or if the answer to the question of cross-tenant data pollution is unacceptable, plan for a tenancy-aware store and keep prom-label-proxy for read filtering only where the tenant boundary is already controlled. Keep the decision and its evidence in your design record, since auditors and security reviewers will ask how tenant data is separated.

How DeployOpen scopes and delivers per-tenant read access

DeployOpen plans per-tenant read access as a fixed-scope piece of work inside your own infrastructure, starting from which teams or customers need which metrics and how they authenticate. The build covers the label enforcement, the authenticating proxy in front of it, testing of tenant boundaries, and a written handover your operators can run.

How we scope

  • Map which teams or customers need read access and which label identifies each tenant's metrics.
  • Record the authentication source, the identity provider and the roles that may see cross-tenant views.
  • Agree in writing what is covered, including the write-side gaps that remain open for each scrape pattern.

How we build

  • Deploy prom-label-proxy in front of the Prometheus query API and pair it with an authenticating reverse proxy.
  • Configure the enforced label so every PromQL query, API response and Alertmanager request is scoped to the caller's tenant.
  • Review scrape configuration and relabeling so tenants cannot set or override the label on their own targets.

How we hand over

  • Test tenant boundaries with negative queries from each identity, and record the results as evidence.
  • Document the proxy configuration, identity mapping, label conventions and the known write-side limits.
  • Walk operators through onboarding a new tenant and rotating credentials so the setup can be run without us.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer when the tenant model changes.
  • Retest tenant isolation after Prometheus upgrades, proxy updates or changes to the identity provider.
  • Confirm with your team whether a move to Thanos or Mimir tenancy is needed as tenant count and retention grow.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.