elasticsearch_exporter icon indicating copy to clipboard operation
elasticsearch_exporter copied to clipboard

Node name instead of ID for shard related metrics

Open anitakrueger opened this issue 2 years ago • 3 comments

In my shard level metrics like elasticsearch_indices_shards_store_size_in_bytes the node label shows the node id rather than its name.

elasticsearch_indices_shards_store_size_in_bytes{cluster="dev-elasticsearch",hostname="dev-elasticsearch-01",index="test123",instance="10.2.2.4:49108",job="elasticsearch_exporter",node="3qyB0_WGRYCEzAYwhvSDqQ",port="49108",primary="false",shard="0",version="1.2.1"}

I think the code where this gets added is this line: https://github.com/prometheus-community/elasticsearch_exporter/blob/master/collector/indices.go#L1124

shard.Routing.Node in the allocation stats only has the node ID in there as far as I can tell from looking at /_all/stats.

It would be really nice to have the node name in there as well as I am trying to display those metrics in Grafana and I cannot find a way to lookup the node id within a dashboard.

anitakrueger avatar Oct 21 '21 22:10 anitakrueger

I have the similar requirement where I am trying to capture the shards(primary=true and primary=false) in nodes, hope this request is addressed in next version.

rubensselvakumar avatar Dec 28 '21 13:12 rubensselvakumar

bump, I need node name in shard related metrics to see relation "shards per node" which also indicates how heavily cluster is used, it can be added instead of replacing node-id

korcadr avatar Feb 09 '22 15:02 korcadr

Currently shard-related metrics have only node-id (e.g 3qyB0_WGRYCEzAYwhvSDqQ), and there isn't any other metric which contains both node-node and node-id, so it's impossible to join/extract node-name of shards.

tahajahangir avatar Apr 17 '22 12:04 tahajahangir