ahmed mohiuddin
ahmed mohiuddin

Reputation: 1

Is it possible to append the metrics label value before / after scraping to a different value?

I have a use case where I need to append metrics label value in Prometheus. For example, if my metrics has a label {pod=pod1}, I need to change it to {pod=pod2} before or after scraping. Is this supported?

Upvotes: 0

Views: 259

Answers (1)

Marc ABOUCHACRA
Marc ABOUCHACRA

Reputation: 3463

You need to have a look at those two prometheus configurations :

  1. relabel_config : this will allow you to work with the labels name and value before the scrape
  2. metric_relabel_configs : this will allow you to work with your labels after the scrape (but before ingestion)

You can check out this article which explains a bit more the difference between those two.

Upvotes: 2

Related Questions