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] Parametrized adhoc queries #13109
Comments
Specifically, I'd like to have ad-hoc filters apply to only a limited set of metrics. For example with Prometheus, we have a |
This would be useful for the mongodb-datasource and wavefront-datasource enterprise plugins which currently need to rely on additional template variables (with hardcoded names) that act as links to values such as a query or metric name. |
I'm not sure how the datasource API is used. Would you give more detail on how that would work? |
When you create an adHoc filter you will see 2 drop downs added to your dashboard. One for the filter key and one for the filter value. When you select from the filter key, a method on your datasource class, getTagKeys, will be called to get the key values for the dropdown. When you select from the filter value, getTagValues is called. If you only want keys/values related to device_info, you could create a template variable, something like "metric_link" and set the value to "device_info". Then in getTagKeys, you can reference that variable. Here is an example:
|
@belm0 create a "constant" template variable and set the value to "device_info". Then reference that variable in getTagKeys/getTagValues. Now you have the metric you want for your query. |
When an adhoc template variable is created, every metric of every query in the dashboard gets substituted with it. So if some dashboard query references another metric, say |
Hey @bobrik thanks for the request! We're now using github discussions to track feature requests and improve how we engage in feature discovery, development and delivery. Therefore I'm closing this issue but if you still want your feature to be considered it'd be great if you could reopen it as a discussion! Here is a bit more info about how to open feature requests as discussions. |
Per #73424 can we have this reopened? |
Ad-hoc queries cannot have parameters right now (v5.2.1):
We use a Clickhouse datasource with a database that has 14016 fields. That's not usable for autocomplete and it even takes forever to download and parse JSON with all these fields:
To make this workable, we want to have additional settings for adhoc filters, in our case the filter would narrow down fields to a specific table instead of all databases and tables.
The text was updated successfully, but these errors were encountered: