Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #17061 to 7.x: Use Elasticsearch histogram type to store Prometheus histograms #17227

Merged
merged 2 commits into from
Mar 25, 2020

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Mar 24, 2020

Cherry-pick of PR #17061 to 7.x branch. Original message:

What does this PR do?

Allow to store Prometheus histograms as Elasticsearch histograms when using the collector metricset. This change adds a new use_types feature flag to enable the new behavior. When enabled it will use a new schema for Prometheus metrics:

  • Store counters as prometheus.*.counter
  • Store gauges/untyped as prometheus.*.value
  • Store histograms as prometheus.*.histogram
  • Summaries use the previous types

Also, when using rate_counters, a new prometheus.*.rate field will be created for all counter metrics. It stores the increment of the counter since the last fetch.

image

image

For better results, it is recommended to use tdigest.compression: 1 when calculating percentiles:

image

A note on graph fidelity

This is a first stab at supporting Prometheus Histograms using Elasticsearch histograms. As algorithms and query semantics differ between these two projects, the resulting graphs are not exactly the same (while both are representing correct data).

We will keep working with the Elasticsearch team to provide better fidelity when compared to Prometheus way of graphing histograms. This will be a good start: elastic/elasticsearch#49452

Why is it important?

Histograms are a big part of Prometheus metrics, and being able to store and query them correctly is a great feature when dealing with these.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

This feature requires Elasticsearch 7.6 or later. Also Kibana support is not yet merged into master, I'm testing this in combination with elastic/kibana#59387.

Related issues

Closes #14843

…tic#17061)

* Allow to override already defined metricsets

This is useful when we want to have different behaviors between flavours

* Add new Prometheus skeleton for basic types usage

* Refactor Prometheus module to accommodate newer uses

* Add typed schema to Prometheus module

This should make room for using different Elasticsearch types depending
on the Prometheus metric

* Convert Prometheus histograms to ES histograms

Co-authored-by: Chris Mark <[email protected]>
Co-authored-by: Jaime Soriano Pastor <[email protected]>
(cherry picked from commit 142b859)
@exekias exekias merged commit 648fa1a into elastic:7.x Mar 25, 2020
@BobBlank12
Copy link

@exekias Will this be back ported into 7.7?

@exekias
Copy link
Contributor Author

exekias commented Mar 26, 2020

yes, this has been backported and will be part of 7.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants