Elasticsearch now supports histograms in its default distribution: elastic/elasticsearch#48580
We can adapt Prometheus module to take benefit from it and store histograms using this type. There are some transformations that are needed when pushing Prometheus histograms:
- Calculate rates from cumulative counters (this requires us to keep a cache of the previous fetch)
- Then calculate centroids for buckets with their occurrence count
- +Inf bucket will require some special treatment
We will still need a fallback option for versions without the histogram type
Some initial tests can be found here: https://gist.github.com/exekias/3860f182169b4fa8f3ea02c82770be55#file-scrape-py
Elasticsearch now supports histograms in its default distribution: elastic/elasticsearch#48580
We can adapt Prometheus module to take benefit from it and store histograms using this type. There are some transformations that are needed when pushing Prometheus histograms:
We will still need a fallback option for versions without the histogram type
Some initial tests can be found here: https://gist.github.com/exekias/3860f182169b4fa8f3ea02c82770be55#file-scrape-py