# Grafana and multi-tenant Cortex

**URL:** <https://community.grafana.com/t/grafana-and-multi-tenant-cortex/22938>\
**Category:** Grafana\
**Created:** [November 15, 2019, 10:12am UTC](https://community.grafana.com/t/grafana-and-multi-tenant-cortex/22938 "2019-11-15T10:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yohann](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@yohann](https://community.grafana.com/u/yohann)\
**Post date:** [November 15, 2019, 10:12am UTC](https://community.grafana.com/t/grafana-and-multi-tenant-cortex/22938/1 "2019-11-15T10:12:48Z")

</div>

Hello,

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

The Cortex [documentation](https://github.com/cortexproject/cortex/blob/master/docs/running.md) 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](https://github.com/cortexproject/cortex/blob/master/docs/auth.md).

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?  
Thanks

---

<div class="post-metadata">

**Author:** ![hammond95](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/hammond95/32/18681_2.png) [@hammond95](https://community.grafana.com/u/hammond95)\
**Post date:** [September 15, 2021, 10:53pm UTC](https://community.grafana.com/t/grafana-and-multi-tenant-cortex/22938/2 "2021-09-15T22:53:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![davidriod](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@davidriod](https://community.grafana.com/u/davidriod)\
**Post date:** [December 21, 2021, 9:30am UTC](https://community.grafana.com/t/grafana-and-multi-tenant-cortex/22938/3 "2021-12-21T09:30:52Z")

</div>

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.
