-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 meta-variable for better templating experience #16694
Conversation
Meta-variable allows to reference already declared variables which gives additional flexibility in queries. Such as declaring common filters, creating dynamic queries or using CTE extensions in databases like VictoriaMetrics.
Meta-variables could significantly simplify dashboards building process. Let's take nodeexporter dashboard: Or someone can use meta-variable: It is easy now to change common filter for all panels on the dashboard by modifying just one variable. Using this approach also protects from copy&paste errors. |
Are there any updates on this PR? cc'ing @torkelo . |
Hi @torkelo! Can I have some response regarding PR or issue? |
Not sure this is the best solution for the underlying problem, maybe some kind of query template feature would solve this better? |
@torkelo , could you elaborate on query template feature? Template meta-vars may be applied to any data source or query language. |
Query template doesn't help when you need to modify all existing queries. The only possible way to do it in "easy" way is to export dashboard in json and do find&replace in some editor. |
This pull request has been automatically marked as stale because it has not had activity in the last 2 weeks. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
@torkelo , are there any decision updates on this pull request? |
This pull request has been automatically marked as stale because it has not had activity in the last 2 weeks. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Meta-variable allows to reference already declared variables
which gives additional flexibility in queries.
What this PR does / why we need it:
Meta-variable allows to reference already declared variables which gives additional flexibility in queries. For example, create variable
commonFilter
with following content:region=~"$region", instance=~"$instance"
, whereregion
andinstance
were already declared. Then we can use meta-variable in query:up{$commonFilter}
.Which issue(s) this PR fixes:
Fixes #16582