Yes, by adding the common labels to each target group:
[
{
"targets": [
"localhost:9100"
],
"labels": {
* "env": "production",*
"job": "slave"
}
},
{
"targets": [
"localhost:9200"
],
"labels": {
* "env": "production",*
"job": "master"
}
}
]
(pre-process your JSON if you don't like doing that by hand).
Alternatively, if the labels are common to *all* targets in that file, then
you can add them using label rewriting in the prometheus job config.
Note though: it is generally not a good idea to override the "job" label.
This is one used by prometheus itself to identify the scrape job, and helps
to keep metrics unique.
--
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/0a39b0d9-c14d-4098-999e-2c185ed39ee8o%40googlegroups.com.