-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implementing variables? #69
Comments
@PeterSurda Do you refer to this? I created a custom variable 'HOST' with values (rpi4, raspberrypi, yi-Ideapad), and used it in query tag=value as host=$HOST. |
You got it, except I want the variable values to be generated dynamically. In InfluxDB and QuestDB for example I can specify a query to produce the list:
Grafana documentation says that for OpenTSDB the query is |
Well, what I could do is to have a process, run by a scheduler, that will run a query and use a grafana api call to populate the variable. |
TT doesn't support APIs (e.g., tag_values(tag)) to retrieve values associated with a tag currently (v.0.12.1). The closest API is To support retrieval of values of a tag, another index between a tag and its values is needed. We will put the functionality in the future list. Hope it is not a dealbreaker for you to use TT. |
Thank you, I'll find some workaround. Even with this TT seems like the best choice so far (migrating away from rrdtool I also tried graphite carbon, influx, questdb). This below for example is a quick PoC to produce a list of hosts for a specific chart that have data in the last minute:
|
That's a smart workaround, even better than building an internal index (which is costly). |
Now I just have to figure out how to do that inside grafana rather than in a shell. |
Grafana variables will be supported in our next release (v0.20.4). For example, you can edit any of your dashboards, define a variable called, say, 'host_var'. In the 'Query' section, put "tag_values(cpu_usr, host)". Then on your dashboard, you can add a tag filter whose value is the variable "$host_var". This allows you to use the drop-down menu at the top to switch to any hosts and display metrics for that particular host. If you want this variable to work for ALL the metrics on the dashboard (not just 'cpu_usr' as in the above example), you can put "tag_values(*, host)" in the 'Query' section. It will work for any metrics on the dashboard. |
I'm trying to add a variable in grafana from TickTockDB data source, and it doesn't produce any results. I suspect the API to do this isn't implemented in TickTockDB. Do you know more about this? I don't know enough about what's missing and the design in order to implement it.
I use collectd to feed the data, but I put telegraf in the middle so that it can add the necessary tags (collectd's opentsdb output doesn't have tags). I want mainly a variable from the "host" tag, that would be adequate. Then I could select the host for a chart from a drop down menu.
The text was updated successfully, but these errors were encountered: