Introduce a "AllowList" for label values

12 views
Skip to first unread message

Andreas Wederbrand

unread,
Jan 18, 2021, 5:09:44 AM1/18/21
to Prometheus Users
Hi!

I didn't find how in the documentations so I added this
https://github.com/prometheus/prometheus/issues/8375

Turns out it might be possible using.
But, did I missunderstand what a "label name" is in regards to labelmap and labelkeep?

It sounds like this is to keep labels entirly, not the values of them.

To be clear. This is what I would like for all metrics and from all targets
http_request_duration_seconds_count{client_name="the app"} 1
http_request_duration_seconds_count{client_name="the new app"} 1
http_request_duration_seconds_count{client_name="bogus guy 1"} 1
http_request_duration_seconds_count{client_name="bogus guy 2"} 1

turns into 
http_request_duration_seconds_count{client_name="the app"} 1
http_request_duration_seconds_count{client_name="the new app"} 1
http_request_duration_seconds_count{client_name="OTHER"} 2


"the app" and "the new app" would be in a AllowList for all metrics but other values should either be dropped or, better, bunched together as OTHER.

Cheers.

Ben Kochie

unread,
Jan 18, 2021, 5:20:39 AM1/18/21
to Andreas Wederbrand, Prometheus Users
Doing math in metric_relabel_configs is not possible. The only way to fix this is with a recording rule, or to fix the source data.

An "AllowList" wouldn't solve this either. Prometheus does not manipulate values on ingestion, this is intentional. It only stores exactly what is exposed.

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0cbf5f8f-ff5c-443e-bc0f-608bdcd260f3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages