OpenMetrics and the Prometheus exposition format require the metric name
to consist only of alphanumericals and "_", ":" and they must not start
with digits. The metric names from the ethtool stats might contain
spaces, brackets, and dots. Converting them directly to metric names
will produce invalid metric names.
Therefore sanitize the metric names and convert them to lower case.
Fixes: https://github.com/prometheus/node_exporter/issues/2083
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
pull/2080/head
Benjamin Drung5 years agocommitted byJohannes 'fish' Ziemke
ethtoolIgnoredDevices=kingpin.Flag("collector.ethtool.ignored-devices","Regexp of net devices to ignore for ethtool collector.").Default("^$").String()
ethtoolIncludedMetrics=kingpin.Flag("collector.ethtool.metrics-include","Regexp of ethtool stats to include.").Default(".*").String()