On Sun 22 Nov 2020, 17:01 Kaloyan Simitchiyski, < [email protected]> wrote:
> Hi folks, > > I'm using the jmx-exporter to collect metrics from Kafka brokers. However, > I'm having a bit of trouble with a particular regex pattern: > > - pattern: kafka.network<type=RequestMetrics, name=ErrorsPerSec, > request=(.+), error=(^(?!NONE$).*)><>Count > name: kafka_request_errors_total > type: COUNTER > cache: true > labels: > request: "$1" > error: "$2" > > I want to collect every sample except in the cases when the error > attribute is NONE. The rule does not seem to work as the jmx-exporter stops > returning the metric altogether. If I change the pattern to *error=(.+) *it > works just fine. > Have you guys done something similar? Is something wrong with my approach? > The ^ and $ are anchoring to the whole line, so that can never match. Try without them. Brian > -- > 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/9944a9e0-a3b1-4d6c-b6f9-e3ca14773922n%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/9944a9e0-a3b1-4d6c-b6f9-e3ca14773922n%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/CAHJKeLokZG3_LmxQS5v_Qy72pcAMcKiSVp6Fhn_k9ToGyp4VSQ%40mail.gmail.com.

