Hi Brian,

Makes sense why it didn't work... Everything is fine now. Thanks!

On Sunday, November 22, 2020 at 9:28:51 PM UTC+2 Brian Brazil wrote:

>
>
> 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/fcac4a80-067a-4571-bbd2-f55426fe6e41n%40googlegroups.com.

Reply via email to