grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.95k stars 3.45k forks source link

Support multiple X-Scope-OrgID headers for querying logs #9056

Open Kirchen99 opened 1 year ago

Kirchen99 commented 1 year ago

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

We are currently using Grafana Loki on a shared Kubernetes cluster, where each namespace serves as a tenant. Currently, Grafana Loki supports passing multiple tenant IDs as a single string separated by "|", but this may not be sufficient for certain use cases where users need to query logs for multiple tenants that they are authorized to access. For example, we use kube-rbac-proxy to perform RBAC authorization and kube-rbac-proxy supports specifying the same header several times but does not support a single string separated by "|".

Describe the solution you'd like

I suggest adding support for accepting multiple X-Scope-OrgID headers so that users can easily query logs for multiple tenants that they are authorized to access. This feature would greatly improve the flexibility and usability of the Grafana Loki API for multi-tenant use cases.

Additional context

How multi-tenant queries work: https://grafana.com/blog/2022/07/27/grafana-loki-2.6-release/

jeschkies commented 1 year ago

I like the idea but if I'm not with the header is processed in the weaveworks common library. So we'd have to make the change there or fork it.

TheMatrix97 commented 6 months ago

Same problem here, would be wonderful to have a more intuitive and flexible X-Scope-OrgID behavior