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

Feature request: Template variables for dashboard UID, panel ID and template Index #87859

Open
oplehto opened this issue May 14, 2024 · 0 comments

Comments

@oplehto
Copy link

oplehto commented May 14, 2024

Why is this needed:
Having template variables for the dashboard UID, panel ID and template index would accomplish at least two things:

  1. Be able to pass fine-grained information about the source of the query to the datasource, for example by using an SQL comment. This will make it possible to quickly trace back problematic queries to the originating panel or template variable.
  2. Make it possible to pass enough context in data links to be able to refer back to the exact panel where the query was coming from

What would you like to be added:
3 template variables:
$__dashboard_uid - The UID of the current dashboard
$__panel_id - The panel ID of the current panel (only for queries in panels)
$__template_idx - The index of the template variable (only for template variable queries)

Who is this feature for?
Advanced users with large dashboards and datasource developers who want to include fine-grained information of Grafana usage into the datasource's query log. Possibly others as well?

@oplehto oplehto changed the title Template variables for dashboard UID, panel ID and template Index Feature request: Template variables for dashboard UID, panel ID and template Index May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant