First idea in adding histogram metric#17894
Closed
andsel wants to merge 17 commits intoelastic:mainfrom
Closed
Conversation
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
3 tasks
Contributor
|
This pull request does not have a backport label. Could you fix it @andsel? 🙏
|
1 task
0ebad0f to
a199631
Compare
andsel
commented
Aug 12, 2025
| /** | ||
| * Class to expose percentiles retrieved from an HdrHistogram. | ||
| * */ | ||
| public final class HistogramSnapshot implements Serializable { |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer
Implements Serializable so that Valuefier can use the identity converter.
andsel
commented
Aug 12, 2025
| ) | ||
| ); | ||
| converters.put(SecretVariable.class, JAVAUTIL_CONVERTER); | ||
| converters.put(HistogramSnapshot.class, JAVAUTIL_CONVERTER); |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer
The x-pack monitoring pipeline create Logstash events which contains this snapshot, and need to be converted to Ruby object in the Rubyfier.deep method.
…te metrics inside, for example, the queue reader client
…hat in case no collector is provided it return safely
…erted by the Valuefier
…on of batch size related metrics into histrograms
…nd spread around to reach in memory queue client and control the batch size metrics. Covered with tests the readBatch code to verify the effectiveness of the flag
506c59c to
1e27899
Compare
…ch_size->[75Percentile, 90Percentile] to {pipeline_name}->batch->event_count->[p75, p90]
|
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @andsel |
Contributor
Author
|
Super seeded by #18503 |
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.





Release notes
[rn:skip]
What does this PR do?
Create a new histogram metric type. Updated all metric infrastructure code, the core class is
HistogramMetricwhich uses HdrHistogramRecorderto track the measurements and produces a newHistogramSnapshotevery timegetValueis invoked, clearing the measurements stored in theRecorder.HistogramSnapshotis a data class that exposes75Percentileand90Percentile(at the moment).To verify the effectiveness of this, the memory queue read client was updated to expose a metric to track the batch size.
Created a new setting named
pipeline.batch.metricswith values"true"and"false"(at the moment), to enable and disable the computation of such metrics. This setting is a string because in a follow up PR will become a tri-state flag.Why is it important/What is the impact to the user?
This is an intermediate step, it has to proof the exposition of new metric section under the
_node/statsAPI endpoint like:Percentiles are also pushed down to ES when leveraging the monitoring.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Run Logstash with the setting
pipeline.batch.metricswith values"true"and verify that node stats exposes thebatch_sizehistogram.curl http://localhost:9600/_node/stats | jq .pipelines.main.eventsRelated issues
Use cases
Screenshots
Logs