prometheus-community/elasticsearch_exporter

Clean Up Snapshot Metrics and Labels

sysadmind opened this issue · 0 comments

The labels on the snapshot collector are confusing and need to be cleaned up. The labels match on most of the metrics, but in some cases they contradict the metric itself.

For example:

# HELP elasticsearch_snapshot_stats_snapshot_failed_shards Last snapshot failed shards
# TYPE elasticsearch_snapshot_stats_snapshot_failed_shards gauge
elasticsearch_snapshot_stats_snapshot_failed_shards{repository="test1",state="SUCCESS",version="5.4.2"} 1

The label state=SUCCESS does not make sense for a metric about failed shards. In this case, the HELP is not very helpful and could be more descriptive.

The default labels are defined by this func: https://github.com/prometheus-community/elasticsearch_exporter/blob/master/collector/snapshots.go#L45. This means that the state label is the overall state of the snapshot repository. That can be a metric all by itself, removing the need to put the label on every metric.