Hello Brian,

want to say "thank you". The regex worked and the explaination helped a lot 
with following regex. In addition I have to say that I used the 
prometheus.snmp.exporter implementation in Grafana Alloy agent, first. This 
implementation has issues with some regex which are working with the 
snmp_exporter. After using snmp_exporter's debug I could find out which 
other metrics and regex are wrong and could correct themn.

https://github.com/grafana/alloy/issues/4381

Thank you very much!

Brian Candler schrieb am Samstag, 6. September 2025 um 10:59:57 UTC+2:

> > In addition ist it expected that the regex in the generator is different 
> than in the snmp.yml afterwards?
>
> To clarify this point:
>
> ^  = match at start of string only
> (?:    )   = non-capturing group
> $ = match at end of string only
>
> Therefore, by wrapping your original regex with ^(?:   )$ it anchors it at 
> the start and end of the string, without allowing any spurious characters 
> before or after.  This is for consistency with how Prometheus handles 
> regexs elsewhere, e.g. in label matchers, rewriting rules etc.
>

-- 
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 visit 
https://groups.google.com/d/msgid/prometheus-users/a2506052-32ea-4a5a-97a5-7f98305b65dbn%40googlegroups.com.

Reply via email to