-
Notifications
You must be signed in to change notification settings - Fork 96
Format Referer header on X-Dashboard-Title and X-Panel-Title #1433
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @adamyeats, any ETA here? |
SpencerTorres
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, but is it possible to use the array-like behavior of the headers to add more data? I want to make it easier to fetch this out of the query log. The string formatting works, but I'm wondering if we can make it more HTTP-compliant
What I mean is, is it possible where the header can have multiple entries? I forgot the interface in Go, but there should be a way to do that
|
There is one global problem: Grafana doesn't pass most of headers to the datasource plugin, only few number of them, and there are no common HTTP headers. I can adjust the header handler and make it configurable:
E.g. instead of
What do you think? |
SpencerTorres
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is better than what we have now, I just wish we had a better way to attach metadata to queries. This doesn't apply to TCP connections does it?
| if dashboard != "" || panel != "" { | ||
| httpHeaders[headerReferer] = fmt.Sprintf("Dashboard title: %q, panel title: %q", dashboard, panel) | ||
| } else { | ||
| httpHeaders[headerReferer] = "Explorer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically untrue; the query could also come from alerting. You should be able to validate this by checking the uname from the plugin context for grafana_scheduler.
aangelisc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this LGTM. I wonder if we should have this configurable - I'm not sure all users would want this enabled, wdyt?
|
Sure, sounds reasonable. |
The plugin can forward HTTP headers.
Unfortunately, ClickHouse stores only
Refererheader in thesystem.query_log.This PR adds additional header
Refererbased onX-Dashboard-TitleandX-Panel-Title.Examle of how it looks in the
query_log: