--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/36b88b1d-b82c-436e-82b0-8c77d396d696%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
metric_relabel_configs: - source_labels: ["__name__"] modulus: 25 target_label: "__tmp_hash" action: "hashmod" # drop __tmp_hash label for histogram-related metrics - source_labels: ["__name__"] regex: ".*(sum|count|bucket)" target_label: "__tmp_hash" action: labeldropUnfortunately, I think what you want is a "negative lookahead". This is not supported by the re2 library Prometheus uses.
On Mon, Jul 10, 2017 at 10:25 PM, dzhang via Prometheus Users <promethe...@googlegroups.com> wrote:
Hello all,I was just wondering how I can exclude some metrics while relabelling metrics and performing hashmod on them. For example. I have a lot of histogram-related metrics which I do not want to relabel/add new label to, so I'm looking for a way to match all metrics **without** the strings "sum", "bucket", or "count" in their names. How can I do that?Thanks.
--
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 post to this group, send email to promethe...@googlegroups.com.
Hello Ben,Thank you very much for your reply. Do you think the following will work?metric_relabel_configs:- source_labels: ["__name__"]modulus: 25target_label: "__tmp_hash"action: "hashmod"# drop __tmp_hash label for histogram-related metrics- source_labels: ["__name__"]regex: ".*(sum|count|bucket)"target_label: "__tmp_hash"action: labeldrop
Thanks,DZ
On Monday, July 10, 2017 at 1:58:12 PM UTC-7, Ben Kochie wrote:Unfortunately, I think what you want is a "negative lookahead". This is not supported by the re2 library Prometheus uses.On Mon, Jul 10, 2017 at 10:25 PM, dzhang via Prometheus Users <promethe...@googlegroups.com> wrote:Hello all,--I was just wondering how I can exclude some metrics while relabelling metrics and performing hashmod on them. For example. I have a lot of histogram-related metrics which I do not want to relabel/add new label to, so I'm looking for a way to match all metrics **without** the strings "sum", "bucket", or "count" in their names. How can I do that?Thanks.
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/36b88b1d-b82c-436e-82b0-8c77d396d696%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/112441a3-399e-4e61-b836-c549a7b720be%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/112441a3-399e-4e61-b836-c549a7b720be%40googlegroups.com.