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

Add identifying metadata on requests to the ClickHouse query log #435

Closed
oplehto opened this issue Jul 18, 2022 · 3 comments · Fixed by #537
Closed

Add identifying metadata on requests to the ClickHouse query log #435

oplehto opened this issue Jul 18, 2022 · 3 comments · Fixed by #537
Assignees
Labels
p2 Priority 2
Milestone

Comments

@oplehto
Copy link

oplehto commented Jul 18, 2022

It would be very useful to have more information of the Grafana client requests in the ClickHouse query log. This will help pinpoint those panels and users which are hitting ClickHouse backends particularly heavily.

Primarily:

  • Grafana user
  • Panel or template variable definition which initiated the query
  • Grafana query ID

Seems like the log_comment column in system.query_log could be used for storing this in JSON, although the http_referer might be more appropriate for the panel.

@oplehto oplehto changed the title Add identifying information on requests Add identifying metadata on requests to the ClickHouse query log Jul 18, 2022
@Slach Slach self-assigned this Jul 18, 2022
@Slach
Copy link
Collaborator

Slach commented Jul 20, 2022

we need to figure out and ensure could grafana core pass some metadata in headers
we easily can add required metadata in query body with comment

@UnamedRus
Copy link

There are global variables in grafana, can them be used here?

https://grafana.com/docs/grafana/v8.5/variables/variable-types/global-variables/#__user

@Slach Slach added this to the 3.0.0 milestone Nov 20, 2023
@Slach
Copy link
Collaborator

Slach commented Feb 13, 2024

Also available other

https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#__dashboard

better will implement option in QueryEditor
like
"send metadata" which will add comment in request with /* $__dashboard $__user */
and turn on it by default

@svb-alt svb-alt added the p2 Priority 2 label Apr 1, 2024
Slach added a commit that referenced this issue Apr 16, 2024
…ork, look details #435 (comment)

Signed-off-by: Eugene Klimov <eklimov@altinity.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 Priority 2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants