fix(collector): use gauge type for data stream metrics - #1237
Open
locker95 wants to merge 1 commit into
Open
Conversation
elasticsearch_data_stream_store_size_bytes and elasticsearch_data_stream_backing_indices_total were emitted as counters, but both values can decrease (store size shrinks on merges and deletes; backing index count drops on ILM delete/shrink after rollover). Emit them as gauges, matching the types already documented in metrics.md. Metric names are unchanged. Fixes prometheus-community#797 Signed-off-by: Dean Chen <862469039@qq.com>
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.
The data stream collector emits
elasticsearch_data_stream_store_size_bytesandelasticsearch_data_stream_backing_indices_totalas counters, but neither value is monotonic: store size shrinks when segments merge or documents are deleted, and the backing index count drops when ILM deletes or shrinks rolled-over indices. This was reported in #797.This changes both to gauges. Metric names are unchanged, and metrics.md already documents both as gauge, so this also brings the code in line with the docs.
Probably worth a line in the changelog: dashboards applying
rate()/increase()to these series were getting misleading results already, but tooling that keys off the exposed TYPE will see it change from counter to gauge.Fixes #797