Bug: Custom Query Parameters on Prometheus Datasource Have No Effect When Using Thanos #8459
Unanswered
KUMNISIP
asked this question in
Questions & Answers
Replies: 1 comment 4 replies
-
Is there any way we could simplify the reproduction steps so that we wouldn't have to run Grafana or something else? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
helm version - v3
kubectl version - 1.33.2
chart : kube-prometheus-stack
chart version - v72.3.1
Even though custom query parameters are configured for the Prometheus datasource, they do not appear to have any effect on queries that are routed through Thanos. The same queries, when executed directly against Prometheus (bypassing Thanos), work as expected with the custom parameters applied.
When configuring a Prometheus datasource in Grafana with custom query parameters, these parameters should be passed correctly to the Prometheus instance (or Thanos if used). The query should be modified as per the custom parameters, resulting in correct and expected data retrieval
Reproducing
Set up kube-prometheus-stack with Thanos as the Prometheus remote storage.
Configure a Prometheus datasource in Grafana, specifying custom query parameters (e.g., time range, filters, etc.).
Create a panel in Grafana that uses the Prometheus datasource with the custom parameters.
Observe that the custom parameters do not affect the query when routed through Thanos.
You can prove it by setting any label in the custom query parameters box. And then do a query against a metric that has that label value as well as other values ie
a namespace label for any metric "namespace=kube-prom" but you will still get metrics back from all namespaces
Basically if you do the customQueryParamaters setting in the thanos datasource in grafana, adding a label like we did has no effect
ArgoCD was used
The lines added to the .YAML were:
customQueryParameters: "environment=dev-k8s"
Beta Was this translation helpful? Give feedback.
All reactions