Are you sure this isn't an issue with OctetString vs DIsplayString? Can you
share your generator.yml?

On Fri, Dec 18, 2020 at 1:58 PM Michael Thomas <[email protected]> wrote:

> I need to perform a large number (~120) of metric label remappings in my
> prometheus config.  Right now I'm doing it with 120 entries that look like
> these:
>
>       - source_labels: [fcFeModuleName,fcFxPortIndex]
>         target_label: portName
>         regex: 0x100000C0DD18FE13;1
>         replacement: DeviceName
>       - source_labels: [fcFeModuleName,fcFxPortIndex]
>         target_label: portName
>         regex: 0x100000C0DD18FE13;2
>         replacement: AnotherDeviceName
>
> ...repeated for many different combinations of fcFeModuleName and
> fcFxPortIndex.  The regex that I'm using doesn't have any RE patterns in
> it, so this mapping could be reduced to a simple non-regex map.  I was
> hoping I could do something a little more concise, like this:
>
>       - source_labels: [fcFeModuleName,fcFxPortIndex]
>         target_label: portName
>         replacement_map:
>           "0x100000C0DD18FE13;1": DeviceName
>           "0x100000C0DD18FE13;2": AnotherDeviceName
>           "0x100000C0DD18FE13;3": andYetAnother
>
> Is something concise like this already possible, or should I file a RFE?
>
> I do note that if I were scraping an ethernet switch, I could use
> portIndex+portName in my snmp_exporter to assign friendly names as labels
> automatically.  But my fiberchannel switch does not expose the friendly
> names via snmp, thus the need to do the friendly name label assignment
> individually in prometheus.
>
> --Mike
>
> --
> 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/fbbde3aa-7c48-4a2c-9998-ecb6827f01b3n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/fbbde3aa-7c48-4a2c-9998-ecb6827f01b3n%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/CABbyFmopjV8urb1dafiarm9Kps2dpis1Td%2BVcszT3BqVjT_zAw%40mail.gmail.com.

Reply via email to