Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set the same header multiple time in Prometheus Datascources #829

Closed
sathieu opened this issue Dec 5, 2023 · 1 comment · Fixed by #830
Closed

Allow to set the same header multiple time in Prometheus Datascources #829

sathieu opened this issue Dec 5, 2023 · 1 comment · Fixed by #830
Assignees
Labels
enhancement New feature or request

Comments

@sathieu
Copy link
Contributor

sathieu commented Dec 5, 2023

What would you like to be added:

We use prom-label-proxy to setup some multi-tenant Prometheus. Launched with:

prom-label-proxy \
  --insecure-listen-address=0.0.0.0:8080 \
  --upstream=http://prometheus-stack-kube-prom-prometheus.prometheus-stack:9090/ \
  --label=namespace \
  --internal-listen-address=0.0.0.0:9090 \
  --enable-label-apis=true \
  --error-on-replace=true \
  --header-name=X-Namespace \

We have a tenant which needs access to 2 namespaces ns1 and ns2.

This can be done by setting the header twice:

X-Namespace: ns1
X-Namespace: ns2

But this doesn't work when set from UI:

image

Why is this needed:

See above

Code references:

We need to change .Set to .Add in:

for key, value := range opts.Headers {
req.Header.Set(key, value)
}

But opts.Headers type should be changed to. A new middleware is probably needed.

@sathieu sathieu added the enhancement New feature or request label Dec 5, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 5, 2023
@sathieu
Copy link
Contributor Author

sathieu commented Dec 5, 2023

See #830

sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 5, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 5, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 11, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 11, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 14, 2023
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Dec 18, 2023
@academo academo moved this to 🧑‍💻 In development in Plugins Platform / Grafana Community Feb 28, 2024
@marefr marefr moved this from 🧑‍💻 In development to 🔬 In review in Plugins Platform / Grafana Community Mar 6, 2024
@marefr marefr moved this to 🧑‍💻 In development in Plugins Platform / Grafana Community Mar 6, 2024
@marefr marefr moved this from 🧑‍💻 In development to 🔬 In review in Plugins Platform / Grafana Community Mar 6, 2024
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Mar 8, 2024
sathieu added a commit to sathieu/grafana-plugin-sdk-go that referenced this issue Mar 11, 2024
@github-project-automation github-project-automation bot moved this from 🔬 In review to 🚀 Shipped in Plugins Platform / Grafana Community Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment