metric_relabel_configs: What happens if labels become non-unique?

Viewed 702

In several articles I find stuff like this on the use of metric_relabels_config:

Note, with label dropping you need to ensure that the final metrics after label drop are still uniquely labeled and not resulting in duplicate time-series with different values.

source

But what happens if an action results in a time-series with a label combination that already exists?

Use-case: Using the relabeling to move http time-series with return codes like 404 and 403 to 4xx and so on. Does this work correctly (adding up the values) or will Prometheus enter "undefined state"?

1 Answers

The time series will clash, and will not all be ingested. This is not something you want.

Does this work correctly (adding up the values)

For addition you need the data inside Prometheus's TSDB first, as only PromQL is where aggregation would happen.

Related