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

Always propagate Grafana proxy headers #700

Open
yeya24 opened this issue Dec 3, 2024 · 4 comments
Open

Always propagate Grafana proxy headers #700

yeya24 opened this issue Dec 3, 2024 · 4 comments

Comments

@yeya24
Copy link

yeya24 commented Dec 3, 2024

X-Dashboard-Uid and X-Panel-Id are HTTP headers set by Grafana frontend and forward to datasource (See grafana/grafana#60301). They are useful information for datasources to troubleshoot slow dashboards and panels. Projects such as Thanos and Cortex logs these 2 headers to debug slow queries.

If promxy is used as Grafana datasource, it doesn't propagate X-Dashboard-Uid and X-Panel-Id by default. Users have to configure proxy-headers to add these HTTP headers.

Given the wide adoption of Grafana, I propose that we always propagate X-Dashboard-Uid and X-Panel-Id in Promxy so that it can work out of the box without any configuration.

@yeya24
Copy link
Author

yeya24 commented Dec 4, 2024

@jacksontj Can you please take a look at this issue? If it makes sense, I am happy to create a PR to add it

@jacksontj
Copy link
Owner

This actually sounds like an excellent feature! There is already a feature for statically setting headers (https://github.com/jacksontj/promxy/blob/master/pkg/servergroup/config.go#L211-L215) -- so this seems like a simple expansion of that feature to allow some headers to be proxied (instead of statically set).

IMO I'd prefer to keep this generic (i.e. configurable headers to propagate) rather than the hard coded 2 headers described.

I'd like if we could re-use the same option (since its all http_headers) -- but open to suggestions if that seems/feels too messy.

@yeya24
Copy link
Author

yeya24 commented Dec 7, 2024

I think there is already a feature to propagate those headers. It is the proxy headers config which allows users to proxy some headers based on name.

For what you mentioned, the existing http headers config are something different IIUC.

The purpose of this issue is to always propagate those Grafana headers to avoid manual configuration of proxy headers field as Grafana is commonly adopted.

@jacksontj
Copy link
Owner

In general I'm opposed to having additional features to avoid people writing configs. If this is a common default option IMO we should add it to the example config files -- instead of adding another feature to forcibly add it all the time.

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

No branches or pull requests

2 participants