On Friday, 5 September 2025 at 21:58:15 UTC+1 Alexander Wilke wrote:
I get this in my generated snmp.yml:
...
regex: ^(?:([0-9.]+))$
You can see that this resulting regex is anchored, so it will not match a
value with a literal "%" at the end. So first thing to fix in your
generator source is:
- regex: '([0-9.]+)%'
or
- regex: '([0-9.]+).*'
Also, remove "type: Float", or set "type: DisplayString" - because the
actual SNMP type is DisplayString, the regex needs to match against a
string, and the final value is implicitly parsed as a float.
You can find working examples in the sample generator.yml:
overrides:
...
pduMainLoadAmp:
regex_extracts:
'':
- regex: '(.*)(.)'
value: '$1.$2'
overrides:
ddmStatusBiasCurrent:
type: DisplayString
regex_extracts:
'':
- regex: '^(\d+\.\d+).*'
value: '$1'
--
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/3d804034-a30e-473e-b2ff-fa3e4656f679n%40googlegroups.com.