Skip to content

[prometheusremotewriteexporter] multi-tenancy support based on labels #7945

@foxlegend

Description

@foxlegend

Is your feature request related to a problem? Please describe.

Cortex and Thanos support multitenancy using a HTTP header (such as "X-Scope-OrgID") or maybe a query parameter (I am thinking about Thanos, but I am not 100% sure about that)..
From my understanding, with the current implementation of the prometheusremotewrite exporter, we should configure an exporter per tenant (by setting the header or the endpoint url).

That means each time we want to add a tenant we should modify collector’s configuration, and we should be aware of all tenants of our infrastructure (I want to say exhaustive).

Describe the solution you'd like

A tenant may add (or through an intermediate collector) a label to the metrics representing its name (for instance tenant="123abc"), and the collector may automatically configure the header or the query param accordingly.

Describe alternatives you've considered

There are some projects such as https://github.com/blind-oracle/cortex-tenant which does the same.
I think that instead of adding a new component to the workflow the collector/prometheusremotewrite exporter may perform the same.

Additional context

I have a working implementation on my fork: main...foxlegend:prometheusremotewriteexporter-multi-tenant

It allows to specify the header to insert and the label to use as tenant name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions