Add this tag to questions regarding Grafana Templating.
Questions tagged [grafana-templating]
188 questions
4
votes
4 answers
How to plot horizontal line in Timeseries in Grafana
I use grafana to plot timeseries data. In a timeseries plot i want to add a constant line which comes from a monitoring level. The value of that level is dynamic (from a postgres database) the timeseries come from a ifluxdb Datasource.
The…

renzop
- 1,194
- 2
- 12
- 26
4
votes
0 answers
Grafana's alert notification templating does not seem to work
I've tried following the steps in this link, but what I see in the alert message is the text itself, i.e. ${Label}, rather than the value of that label. I do not use template variables.
What am I doing wrong?

Tal L
- 342
- 1
- 14
4
votes
2 answers
Grafana (V7) adding variable in table name
I need to be able to use variables in table names - I basically have the same set of tables used for different types of data, so I would like to just have one dashboard and swapping between all types instead of always having to set up multiple…

bouvetIsle
- 93
- 5
4
votes
2 answers
How to calculate percentage in grafana datasource elastic
Need your help,
currently I have value elastic data sample like below :
Completed : 100
Declined : 20
Canceled : 5
How to create percentage success rate result with above condition in grafana with formula :
Completed / ( Completed + Declined +…

Fajar Hadiyanto
- 81
- 2
- 4
4
votes
0 answers
How to auto zoom the grafana dashboard to fit to the data and bins on x axis
I have a grafana dashboard where I am pushing the time series for display purpose. The problem is that I need to zoom in and out depending on the data range. Is there any method to do this automatically

Saurabh Pradhan
- 75
- 5
4
votes
1 answer
How to use request parameter value in Grafana query string
I am using Grafana and my URL string is like:
http://servername:3000/dashboard/db/dashboard?refresh=10s&node=hanoi
How can i use the value of node i.e. "hanoi" in my Grafana Query string.
SELECT count("value") FROM "autogen"."sensor" WHERE…

Ammad
- 4,031
- 12
- 39
- 62
3
votes
1 answer
How do I get metric names in Grafana's message template?
I'm setting up Grafana v8.3.4 alerts. If I use a template like the following
{{ define "test_message" }}
{{ range .Alerts.Firing }}
{{ print .ValueString }}
{{ end }}
{{ end }}
And test the e-mail notification using this template and the…

EduardoCMB
- 392
- 2
- 17
3
votes
0 answers
Grafana + Prometheus Pie Chart Group by
I am trying to build a pie chart using Grafana & Prometheus using Group by
In Grafana's panel
Query A: success
Query B: failure
If there is only single prometheus job, then it's perfect, it will have 2 parts:
success job 1
failure job 1
But this…

shawnngtq
- 687
- 1
- 7
- 24
3
votes
1 answer
Grafana + InfluxDB Flux - query for displaying multi-select variable inputs
We've set up a Grafana cloud + InfluxDB 2.0 (Flux language) cloud instance. As part of this, we've created a custom variable list with "device IDs", called devices.
In a panel, we wish to display parameter data where the user can select one or more…

mfcss
- 1,039
- 1
- 9
- 25
3
votes
2 answers
Grafana multivalue float histogram_quantile
Hi I'm forcing problem with histogram_quantile. If I'll set my variable to multi-value so I can repeat panels. Then I got error which says
parse error at char 21: unexpected character: '\'
My request is:
histogram_quantile($percentile,…

MrNetroful
- 497
- 8
- 28
3
votes
0 answers
Add own custom values on top of the ones returned by the template query
I'm using query options to define the values in my drop down which works quite well.
Besides the variables fetched by the query I'd like to add my own ones. Is that possible?
e.g. my dropdown would look like below
custom value 1
custom value…

Emanuel George Hategan
- 1,123
- 1
- 13
- 22
2
votes
2 answers
Grafana Alerting - setting email subject according to alert labels
I'm trying to include dynamic subject into my Grafana (Grafana v9.5.0, datasource - Logstash) alerts. Goal would be to have subject similar to : "$serviceName is failing...".
I was trying to achieve this with alerting labels (e.g. include label…

eirugn
- 21
- 2
2
votes
1 answer
Grafana - Build a Panel Plugin from Template - Error
I am currently in the process of creating a new panel plugin by following the tutorial located here: Create Plugin and here Build your first plugin.
Steps I followed in accordance with the tutorial:
npm init @grafana/plugin
selected panel type,…

Turtles
- 234
- 3
- 13
2
votes
1 answer
Can we add a dynamic label to a Grafana alert?
I am using Grafana 9.4 for dashboarding and alerting. I currently have an alert set up with:
Query A:
a Prometheus metric with labels like {tenant="tenant1", ...} and legend set to {{tenant}}.
Expression B (the alert…

Marcel Gosselin
- 4,610
- 2
- 31
- 54
2
votes
1 answer
How to get Grafana to include sum of values in tooltip or legend for stacked linechart
I have Kubernetes running (K3s on TrueNAS scale). I've deployed Prometheus and Grafana and am able to access the metrics in Grafana. I now want to create a stacked line chart that shows memory usage by namespace and total memory used by Kubenetes.
I…

Whiskey
- 262
- 3
- 15