ethtool: Prevent duplicate metric names (#2187)
Sanitizing the metric names can lead to duplicate metric names: ``` caller=level.go:63 level=error caller="error gathering metrics: [from Gatherer #2] collected metric \"node_ethtool_giant_hdr\" { label:<name:\"device\" value:\"ens192\" > untyped:<value:0" msg=" > } was collected before with the same name and label values" ``` Generate a map from the sanitized metric names to the metric names from ethtool. In case of duplicate sanitized metric names drop both metrics, because it is unknown which one to take. Fixes: https://github.com/prometheus/node_exporter/issues/2185 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>pull/2210/head
parent
58ab0144af
commit
d85cbaa17c
Loading…
Reference in new issue