elasticsearch_exporter icon indicating copy to clipboard operation
elasticsearch_exporter copied to clipboard

index_total and docs_total returning number of replicated documents

Open rccrdpccl opened this issue 2 years ago • 1 comments

elasticsearch_index_stats_indexing_index_total and elasticsearch_indices_docs_total are returning the number of documents including replicas:

  • if we have 100 documents in index foo with replica 0, we'll see 100 documents. If we increase number of replicas to 2, we will see 300 Same with index operation counters.

Is this intentional in both cases? I am trying to export number of documents, but I would need to divide by replicas (which is not exported in any case at the moment). This has been observed in release v1.5.0 (quay.io/prometheuscommunity/elasticsearch-exporter:v1.5.0) and earlier

rccrdpccl avatar Aug 04 '22 15:08 rccrdpccl

I guess this metric can be retrieved with elasticsearch_indices_shards_docs{index="foo",primary="true"}

rccrdpccl avatar Aug 04 '22 16:08 rccrdpccl