add X-scope-OrgID to Loki datasource

What does this MR do and why?

I've noticed that the loki datasource in grafana isn't working anymore, complaining about the org-id missing.

logger=tsdb.loki endpoint=CheckHealth endpoint=checkHealth pluginId=loki dsName=Loki dsUID=P8E80F9AEF21F6940 uname=sylva-admin@example.com
fromAlert=false t=2025-05-15T09:02:09.024412387Z level=info msg="Prepared request to Loki" duration=58.545µs queriesLength=1 stage=prepareRequest runInParallel=false
logger=tsdb.loki endpoint=CheckHealth endpoint=checkHealth pluginId=loki dsName=Loki dsUID=P8E80F9AEF21F6940 uname=sylva-admin@example.com
 fromAlert=false t=2025-05-15T09:02:09.107957748Z level=error msg="Error received from Loki"
 duration=83.452241ms stage=databaseRequest statusCode=401 contentLength=10 start=1970-01-01T00:00:01Z end=1970-01-01T00:00:04Z step=1s
  query=vector(1)+vector(1) queryType=instant direction=backward maxLines=0 supportingQueryType=none
  lokiHost=loki-gateway.loki.svc.cluster.local lokiPath=/loki/api/v1/query status=error error="no org id\n" statusSource=downstream

logger=tsdb.loki endpoint=CheckHealth t=2025-05-15T09:02:09.108025241Z level=error msg="Loki health check failed" error="error from loki: no org id\n"
logger=context userId=2 orgId=1 uname=sylva-admin@example.com t=2025-05-15T09:02:09.108093934Z level=info msg="Request Completed"
 method=GET path=/api/datasources/uid/P8E80F9AEF21F6940/health status=400 remote_addr=172.18.0.4 time_ms=90 duration=90.300489ms size=106
 referer=https://grafana.sylva/connections/datasources/edit/P8E80F9AEF21F6940 handler=/api/datasources/uid/:uid/health status_source=server

With this mr we're adding the necessary header to the management values so that the datasource can be properly queried.

! This may need a backport into 1.4

Closes: #2388 (closed)

Related reference(s)

Test coverage

CI configuration

Below you can choose test deployment variants to run in this MR's CI.

Click to open to CI configuration

Legend:

Icon Meaning Available values
☁️ Infra Provider capd, capo, capm3
🚀 Bootstrap Provider kubeadm (alias kadm), rke2
🐧 Node OS ubuntu, suse
🛠️ Deployment Options light-deploy, dev-sources, ha, misc, maxsurge-0, logging, no-logging
🎬 Pipeline Scenarios Available scenario list and description
  • 🎬 preview ☁️ capd 🚀 kadm 🐧 ubuntu

  • 🎬 preview ☁️ capo 🚀 rke2 🐧 suse

  • 🎬 preview ☁️ capm3 🚀 rke2 🐧 ubuntu

  • ☁️ capd 🚀 kadm 🛠️ light-deploy 🐧 ubuntu

  • ☁️ capd 🚀 rke2 🛠️ light-deploy 🐧 suse

  • ☁️ capo 🚀 rke2 🐧 suse

  • ☁️ capo 🚀 kadm 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capo 🚀 kadm 🎬 wkld-k8s-upgrade 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 rolling-update-no-wkld 🛠️ ha 🐧 suse

  • ☁️ capo 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ ha 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🐧 suse

  • ☁️ capm3 🚀 kadm 🐧 ubuntu

  • ☁️ capm3 🚀 kadm 🎬 rolling-update-no-wkld 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 wkld-k8s-upgrade 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 rke2 🛠️ misc,ha 🐧 suse

  • ☁️ capm3 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ ha,misc 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 ck8s 🎬 no-wkld 🛠️ light-deploy 🐧 ubuntu

Global config for deployment pipelines

  • autorun pipelines
  • allow failure on pipelines
  • record sylvactl events

Notes:

  • Enabling autorun will make deployment pipelines to be run automatically without human interaction
  • Disabling allow failure will make deployment pipelines mandatory for pipeline success.
  • if both autorun and allow failure are disabled, deployment pipelines will need manual triggering but will be blocking the pipeline

Be aware: after configuration change, pipeline is not triggered automatically. Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.

Edited by Mihai Zaharia

Merge request reports

Loading