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.

On Mon, Jan 18, 2021 at 11:09 AM Andreas Wederbrand <
[email protected]> wrote:

> 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.
>
> --
> 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/0cbf5f8f-ff5c-443e-bc0f-608bdcd260f3n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/0cbf5f8f-ff5c-443e-bc0f-608bdcd260f3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CABbyFmqYyBq2C6O8nFVN3j-wKN_gJAsCpLuWc1XSuw23tEm%2B6A%40mail.gmail.com.

Reply via email to