Is this valid that all my custom metrics has the same job?

18 views
Skip to first unread message

stav alfi

unread,
Oct 22, 2020, 2:00:40 AM10/22/20
to Prometheus Users

Intro

I noticed that all of my custom metrics has the same job value: prometheus-io-scrape.

as you can see in one of my metrics:

3.png

Questions

  • How do I change it to the name of the service? Should I manually add a label job to every metric in the codebase?

  • Why I'm seeing prometheus-io-scrape job everywhere?

More Info

I'm using prom-client for node.js, and Rancher is our prometheus configuration manager

Brian Candler

unread,
Oct 22, 2020, 3:02:21 AM10/22/20
to Prometheus Users
That's the "job" label.  It's added automatically by prometheus, and is set to the name of the scrape job which collected the metric, as documented here:

You should leave it alone.  It's a true piece of information (i.e. the name of the actual scrape job which collected the data), and together with the instance label, it helps ensure that all metrics have unique sets of labels.

However, you *can* customize the instance label - prometheus only adds the default address:port label if you haven't set it to anything else explicitly.  See:
You have to ensure that whatever value you chose is sufficiently unique, i.e. all timeseries for the same metric have different instance labels.
Reply all
Reply to author
Forward
0 new messages