On Wed, 21 Oct 2020 at 19:55, Jhanssen Fávaro <jhanssenfav...@gmail.com>
wrote:

> Hi folks,
> I am used to split a few strings in my ansible playbooks, so I thought it
> would be helpfull in prometheus as well...
>
> Anybody knows how to execute that ?
>

You can use reReplaceAll for that.

Brian


>
> Sample:
>     - alert: Under_Replicated_Partition_Count
>       expr: sum(kafka_server_replicamanager_underreplicatedpartitions)
> by(env,instance) > 0
>       for: 1m
>       labels:
>         severity: critical
>         oid: "1.3.6.1.4.1.50495.15.1.2.3.1"
> *        instance: "{{ $labels.instance|split(':')[0] }}"*
>       annotations:
>         summary: 'Kafka {{ $labels.service_name }}: {{ $value }} under
> replicated partitons'
>         description: 'Under-replicated partitions means that one or more
> replicas are not available. This is usually because a broker is down.
> Restart the broker, and check for errors in the logs.'
>
>
> Best regards
> Jhanssen
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/53e93a3b-9549-4f6d-8e18-a949b657bcd5n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/53e93a3b-9549-4f6d-8e18-a949b657bcd5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Brian Brazil
www.robustperception.io

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAHJKeLqOK3PcFRuijtMsV39Sfyy0Akgc4wb77J%3D9U%3DKNSuYhMA%40mail.gmail.com.

Reply via email to