Use Elasticsearch histogram type to store Prometheus histograms#17061
Merged
exekias merged 34 commits intoelastic:masterfrom Mar 24, 2020
Merged
Use Elasticsearch histogram type to store Prometheus histograms#17061exekias merged 34 commits intoelastic:masterfrom
exekias merged 34 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/integrations-platforms (Team:Platforms) |
ChrsMark
reviewed
Mar 18, 2020
exekias
commented
Mar 18, 2020
Contributor
Author
There was a problem hiding this comment.
@iverase FYI, I'm working on this now 🙂, in case you want to have a look
9f813f7 to
1be82a6
Compare
ChrsMark
reviewed
Mar 19, 2020
This is useful when we want to have different behaviors between flavours
This should make room for using different Elasticsearch types depending on the Prometheus metric
Co-Authored-By: Chris Mark <chrismarkou92@gmail.com>
41ddf1e to
f05f1ce
Compare
58f42fe to
78d1941
Compare
ChrsMark
reviewed
Mar 24, 2020
jsoriano
reviewed
Mar 24, 2020
Member
jsoriano
left a comment
There was a problem hiding this comment.
It LGTM. I think we could use use the new implementation by default in openmetrics from the very beginning as we haven't released it yet, would it make sense?
Apart of that, some minor suggestions and nitpicking.
| } | ||
|
|
||
| func (g *typedGenerator) Start() { | ||
| cfgwarn.Beta("Prometheus 'use_types' setting is beta") |
Member
There was a problem hiding this comment.
This would need to be parameterized for openmetrics if used also there.
| var counts []uint64 | ||
|
|
||
| // calculate centroids and rated counts | ||
| var lastUpper, prevUpper float64 |
Member
There was a problem hiding this comment.
Nit. Use prevLastUpper or secondLastUpper to know that it refers to the second last upper bound seen?
Suggested change
| var lastUpper, prevUpper float64 | |
| var lastUpper, prevLastUpper float64 |
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
added 2 commits
March 24, 2020 16:53
b204a49 to
fff3faf
Compare
exekias
pushed a commit
to exekias/beats
that referenced
this pull request
Mar 24, 2020
…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 <chrismarkou92@gmail.com> Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co> (cherry picked from commit 142b859)
Merged
5 tasks
exekias
pushed a commit
that referenced
this pull request
Mar 25, 2020
…Prometheus histograms (#17227) * Use Elasticsearch histogram type to store Prometheus histograms (#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 <chrismarkou92@gmail.com> Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co> (cherry picked from commit 142b859) * make update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Allow to store Prometheus histograms as Elasticsearch histograms when using the
collectormetricset. This change adds a newuse_typesfeature flag to enable the new behavior. When enabled it will use a new schema for Prometheus metrics:prometheus.*.counterprometheus.*.valueprometheus.*.histogramAlso, when using
rate_counters, a newprometheus.*.ratefield will be created for all counter metrics. It stores the increment of the counter since the last fetch.For better results, it is recommended to use
tdigest.compression: 1when calculating percentiles: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
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