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

/api/v1/label does not apply filter to external labels #6803

Closed
sylr opened this issue Oct 13, 2023 · 2 comments · Fixed by #6816
Closed

/api/v1/label does not apply filter to external labels #6803

sylr opened this issue Oct 13, 2023 · 2 comments · Fixed by #6816

Comments

@sylr
Copy link
Contributor

sylr commented Oct 13, 2023

Thanos, Prometheus and Golang version used: v0.32.3

Object Storage Provider: S3

What happened:

My grafana variables for external labels stopped being filtered

What you expected to happen:

I've 2 external labels env & k8s_cluster and my grafana dashboards have corresponding variables where k8s_cluster is filtered based en selected env values, i.e.:

label_values(prometheus_build_info{env=~"$env"}, k8s_cluster)

However this has stopped working some time ago, I blamed grafana but it's a thanos/prometheus issue.

How to reproduce it (as minimally and precisely as possible):

$ curl https://thanos-query/api/v1/label/env/values?match[]={env=%22prod%22}
{"status":"success","data":["dev","infra","prod","test"]}

This should only reply "prod". At least it used to.

Full logs to relevant components:

Anything else we need to know:

@MichaHoffmann
Copy link
Contributor

I can reproduce this in an acceptance test

@MichaHoffmann
Copy link
Contributor

So Prometheus Store APIs ( Sidecars ) would always just short circuit and return their external label if it has the same name as the requested one. This could explain this; i added an acceptance test to verify behavior for the other Store API implementations too and they were ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants