This is a discussion group for Prometheus, so questions about Grafana would
be best directed to the Grafana community: https://community.grafana.com/
In any case, you haven't shown exactly what you've tried to do.
I do know there are special template queries for Grafana variables. Here
are a couple of examples I've pulled from a local dashboard:
Name: instance
Type: Query
Data source: prometheus
Query: *label_values(ifOperStatus, instance)*
Name: ifName
Type: Query
Data source: prometheus
Query: *query_result(ifOperStatus{instance="$instance"})*
Regex: /.*ifName="([^"]+)".*/
I would have thought you could use *query_result(up==0)*, since that's a
valid PromQL query, and you could pull out the label you want (e.g.
instance) using a Regex as shown.
But if that doesn't work, then please ask on a Grafana forum.
On Thursday, 28 July 2022 at 08:08:47 UTC+1 [email protected] wrote:
> Hi all,
>
> In grafana dashboard I want to create a template variable.
>
> up==0 so that this will give the info which instances are down.
>
> but while declaring up==0, I am getting an error like you should not use
> operators while declaring grafana templates.
>
> Is there anyway to declare?
>
> Thanks & regards,
> Bharath Kumar.
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/4d3bc98e-c931-47a0-beba-e576d153dde4n%40googlegroups.com.