junos_exporter icon indicating copy to clipboard operation
junos_exporter copied to clipboard

dynamic interface labels returns empty labels on all interfaces

Open momorientes opened this issue 4 years ago • 1 comments

Say I have an interface with description test [foo=bar] as expected junos_exporter will correctly map foo=bar into its own label:

# some labels omitted for readability
junos_interface_IPv6_receive_packets_total{description="test [foo=bar]",foo="bar",name="xe-0/1/3"} 1234

However a interface with no labelset in the description on the same device, i.e. LINK switch1 ae0 will have an empty foo="" label.:

junos_interface_IPv6_receive_packets_total{description="LINK switch1 ae0",foo="name="ae1"} 5678

This will be done for every label should there be multiple labels defined.

Prometheus seems to drop these "empty labels" on import, however IMO they shouldn't show up in the exporter. Is this intended behavior?

momorientes avatar Oct 11 '21 17:10 momorientes

Sadly it is. Since the label count of a metric is fix (as defined in the descrption) we have to add them for interfaces not matching the label regex.

czerwonk avatar Oct 19 '21 09:10 czerwonk