-
Notifications
You must be signed in to change notification settings - Fork 3.5k
First idea in adding histogram metric #17894
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
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
This pull request does not have a backport label. Could you fix it @andsel? 🙏
|
0ebad0f
to
a199631
Compare
/** | ||
* Class to expose percentiles retrieved from an HdrHistogram. | ||
* */ | ||
public final class HistogramSnapshot implements Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewer
Implements Serializable
so that Valuefier
can use the identity converter.
) | ||
); | ||
converters.put(SecretVariable.class, JAVAUTIL_CONVERTER); | ||
converters.put(HistogramSnapshot.class, JAVAUTIL_CONVERTER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Release notes
[rn:skip]
What does this PR do?
Create a new histogram metric type. Updated all metric infrastructure code, the core class is
HistogramMetric
which uses HdrHistogramRecorder
to track the measurements and produces a newHistogramSnapshot
every timegetValue
is invoked, clearing the measurements stored in theRecorder
.HistogramSnapshot
is a data class that exposes75Percentile
and90Percentile
(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.metrics
with 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/stats
API 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.metrics
with values"true"
and verify that node stats exposes thebatch_size
histogram.curl http://localhost:9600/_node/stats | jq .pipelines.main.events
Related issues
Use cases
Screenshots
Logs