How to drop all the bucket metrics (which is prone to explode huge cardinality)with right regex pattern

262 views
Skip to first unread message

dineshnithy...@gmail.com

unread,
Mar 3, 2021, 5:49:18 AM3/3/21
to Prometheus Users

Hi Team,

we have tried with below regex pattern to drop all the metrics as below -

http_request_duration_seconds_bucket

we have tried below 2 regex patterns, but none of them helped

metric_relabel_configs:
- source_labels: [__name__]
  regex: (.+)_bucket and .*_bucket
  action: drop

Can someone please help in getting right approach to drop the histogram/bucket metrics

Bjoern Rabenstein

unread,
Mar 5, 2021, 8:38:21 AM3/5/21
to dineshnithy...@gmail.com, Prometheus Users
On 03.03.21 02:49, dineshnithy...@gmail.com wrote:
>
> we have tried with below regex pattern to drop all the metrics as below -
>
> http_request_duration_seconds_bucket
>
> we have tried below 2 regex patterns, but none of them helped
>
> metric_relabel_configs:
> - source_labels: [__name__]
> regex: (.+)_bucket and .*_bucket
> action: drop

Either should work. Perhaps you have added this section to the wrong
scrape config?

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages