Log the estimate of batch metrics memory consumption#18916
Open
andsel wants to merge 10 commits intoelastic:mainfrom
Open
Log the estimate of batch metrics memory consumption#18916andsel wants to merge 10 commits intoelastic:mainfrom
andsel wants to merge 10 commits intoelastic:mainfrom
Conversation
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label. Could you fix it @andsel? 🙏
|
andsel
commented
Mar 31, 2026
| final Class<USER_METRIC> type = metricFactory.getType(); | ||
| if (!type.isAssignableFrom(result.getJavaClass())) { | ||
| LOGGER.warn("UserMetric type mismatch for %s (expected: %s, received: %s); " + | ||
| LOGGER.warn("UserMetric type mismatch for {} (expected: {}, received: {}); " + |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer
I scratched this while checking for other errors, so eventually I can split in a separate PR.
…ons classes. This is needed to avoid start collecting such data on not yet fully initialized pipelines.
…ipeline report tests
andsel
commented
Mar 31, 2026
Comment on lines
+235
to
238
| pipeline_workers_setting = pipeline_settings_obj.get_setting("pipeline.workers") | ||
| allow(pipeline_workers_setting).to receive(:default).and_return(worker_thread_count) | ||
|
|
||
| pipeline_settings.each {|k, v| pipeline_settings_obj.set(k, v) } |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer
This is needed because the above mocking works on the original SETTINGS instance and not on the clone.
andsel
commented
Mar 31, 2026
| input { dummy_input {} } | ||
| filter { | ||
| #{" nil_flushing_filter {}\n" * 2000} | ||
| #{" nil_flushing_filter {}\n" * 2500} |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer
2000 filters produced flaky tests, when run singularly, so raised a little bit the limit.
… metrics. This simplifies the configuration. Instaed of setting also 'pipeline.batch.metrics.sampling_mode' to disabled when 'metric.collect' is set to false. Just set 'metric.collect' to false and batch metricsconsumption log is not printed
💚 Build Succeeded
History
cc @andsel |
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
For each pipeline that has structured batch metrics enabled, log a line with memory consumed to collect such data.
What does this PR do?
Why is it important/What is the impact to the user?
Provides the user a direct information of how much memory the batch flow histograms consumes. With this information the user can select to disable it globally and enable only for single pipelines, if the memory consumption is too big for his setup.
Checklist
[ ] I have made corresponding changes to the documentationAuthor's Checklist
How to test this PR locally
Run Logstash and check that it prints a line like the following, for each pipeline:
Related issues
Use cases
Screenshots
Logs