Hello,
I’m new to Grafana and my inquiry might appear simplistic. I’ve installed Loki using the Grafana Loki Helm chart as per this documentation. The deployment has multi-tenancy enabled by default. To send logs to Loki or to add it as a datasource to Grafana, I need to include X-Scope-OrgId
with the value of tenantID
. My issue is in locating the OrgId set for my type of installation. I’ve attempted to inspect the Loki-gateway(nginx) configurations and all other Kubernetes-related configurations, but I haven’t been able to uncover how to extract the OrgId from my Helm deployment.
X-Scope-OrgId
isn’t set. It’s just a a header, it can be set to anything when you perform a Loki API call. It’s not an authentication mechanism, it’s merely a way for Loki to separate logs based on organization.
In a production scenario you probably don’t want to interface with Loki API by using OrgId directly, because it’s not an authentication mechanism. Instead, you’ll probably want some sort of proxy (such as Nginx) that can handle authentication, then use some sort of user/org mapping and map user to organization ID, then supply the header after user authenticates to Loki.
You can see the helm chart code as an example. There were also other posts in the forum a while ago on similar topic.
Thanks, Tony, it was really helpful.
The issue originated from my inability to send any logs to Loki with any kind of OrgID specified in the header. Upon further investigation, I discovered that the problem is with the Nginx configuration of Loki-gateway when the chart installed as a ‘SingleBinary.’ For some reason, the nginx.conf file proxies requests to services on Kubernetes that don’t exist.
Thanks again