Grafana and multi-tenant Cortex


I want to plug Grafana to query Cortex in a multi-tenancy setup.

The Cortex documentation specifies that managing tenants and allocating IDs must be done outside of Cortex and that Cortex expects the tenant ID to be specified within the “X-Scope-OrgID” HTTP header.

In Grafana, I believe the concept of “Organization” is what I need to manage tenants, but I did not find a mean to specify the “X-Scope-OrgID” to the Prometheus data source used to connect to Cortex.

Is anyone able to clarify how could I achieve that?

1 Like

I know this reply comes really late from the post date, but maybe someone is still looking for a solution.

Headers in the remoteWrite in prometheus can be specified from version 2.25.0.

I guess the OP was wondering how to select the tenant from the grafana datasource in the read path to be used by the UI. The remote write configuration is more related to the write path when metrics are sent by grafana agent.