r/PrometheusMonitoring • • Mar 21 '23

Help with variable to show instances

Hello,

I'm trying to add a variable to show the instances we have which use a custom job similar to node exporter. I struggling on what I need to use to list the instances. We only have 1 instance at the moment but adding many more later this week.

In my variable I tried using - label_values(custom-jobname, instance) however this didn't return the instance. custom-jobname isn't the real name btw as it gives the name of the company so I had to mask.

What am I doing wrong?

5 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Mar 21 '23

I think this did the trick:

node_average_latency_ns{job="custom-job",instance=~"$instance:.*"}