-
Notifications
You must be signed in to change notification settings - Fork 99
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
prom-label-proxy refusing to proxy for Grafana even if the required label is specified #74
Comments
After checking out prom-label-proxy source code https://github.com/prometheus-community/prom-label-proxy/blob/master/injectproxy/routes.go#L189 , and saw how it handles query param verification, I did understand the following: For the same request in my post above, the query params that are parsed are the following:
As a consequence, prom-label-proxy finds no query param with the name I just realized that this is not what prom-label-proxy has been designed for, but could this be a feature to be considered? Thanks for your responses. EDIT: maybe you should edit the description of the project: |
Hi @amine250 , you have to set the custom query parameter like this: |
👋 @amine250 I'm not sure what you're trying to accomplish exactly. The purpose of prom-label-proxy is to enforce dynamically label matchers in PromQL queries, the label key is configured statically and the label value needs to be specified by the caller somehow.
What is confusing in this description? |
Hi @simonpasquier, I think either of us is confusing PromQL query label and HTTP query parameter. While the latter can be specified in Grafana's datasource, the PromQL query label would be specified inside the PromQL query (e.g. For my particular use case, I would like to reject HTTP requests that contain PromQL queries, which don't have the
From what I saw fiddling with prom-label-proxy, it didn't behave as you described. While I've seen some code in https://github.com/prometheus-community/prom-label-proxy/blob/master/injectproxy/routes.go#L198-L225 that maybe implements what I want to achieve, I just couldn't make it work. Only enforcing the HTTP query parameter in Grafana's datasource worked for me, using the v0.3.0. |
Ok I get it now: you want all incoming PromQL queries to have a |
Yes, this is exactly what I need. Access to all data is not an issue for me. In our architecture, we are using a main Thanos querier in front of multiple {Thanos querier+sidecar+prometheus,...} for each application. Enforcing a PromQL label selector, would help us avoid forwarding a PromQL query to every Thanos instance in the cluster, and would only forward it to the Thanos querier that has advertised the particular label. |
Thanks for the reply, really helpful! I think it's quite a departure from the original prom-label-proxy goals but eager to hear the opinion from other @prometheus-community/prom-label-proxy maintainers. |
I know it's a rather late reply :) but It might be somehow possible thanks to #171 (e.g. |
@simonpasquier I think that PR adds the ability to add |
Hello,
I have a Grafana instance with a datasource that points to prom-label-proxy which is in front of a Thanos/Prometheus cluster.
The datasource is configured as below:
The prom-label-proxy is running in EKS as a sidecar, with the following arguments:
When I issue the following query in Grafana, I get the following response:
When I configure my datasource to always have the query param
perimeter
set, it works, but it's not good since I would have to create a separate datasource for each value ofperimeter
:Any ideas?
The text was updated successfully, but these errors were encountered: