Hey Akshay,

Have you checked out https://relabeler.promlabs.com/ ? It is an interactive
web relabling tool - I've found it quite useful in the past.

Hope that helps,

Ian

On Mon, Jul 12, 2021 at 12:13 PM akshay sharma <[email protected]>
wrote:

> Hi,
>
> I'm trying to *drop metrics with specific label values *for ex:
>
> node_network_up{device="d0",instance="xxx",job="Node-1"} 0
> node_network_up{device="x160",instance="xxx",job="Node-1"} 1
> node_network_up{device="x192",instance="xxx",job="Node-1"} 0
> node_network_up{device="d1",instance="xxx",job="Node-1"} 0
> node_network_up{device="l0",instance="xxx",job="Node-1"}
> node_network_up{device="k0",instance="xxx",job="Node-1"}
> node_network_up{device="a0",instance="xxx",job="Node-1"}
>
>
> I want to drop metrics *which has a device name apart from
> x160,x192,d1,d0*.
>
> Note: I've tried added relabel_config as below, but it is not working(when
> giving regex or any generic command).
> metric_relabel_configs:
>   - source_labels: [__name__,device]
>     regex: node_network_up; (x|d).+
>     action: drop
>
> - source_labels: [__name__,device]
>     regex: node_network_up; d*
>     action: drop
>
>
>
>
> *This is working- source_labels: [__name__,device]    regex:
> node_network_up; d1    action: drop*
>
>
>
> Is this a proper way to use relabel_config? If not, please provide some
> example, as there is not example in documentation.
>
>
> --
> 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/CAOrgXNJpw%2BcoLw7RPOhXWRcEQizrPMJKSEe1juXfWsE_y%2B%2BTTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAOrgXNJpw%2BcoLw7RPOhXWRcEQizrPMJKSEe1juXfWsE_y%2B%2BTTg%40mail.gmail.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/CADoMBNXSu80RxB%2BCEkO3Zd08Axi%2Bo3x6R4Dd1rdrHDwxn5AeNA%40mail.gmail.com.

Reply via email to