[Elastic Agent] Add queue depth, output batch size and rate #7611
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?
This adds more in depth metrics for viewing output batches sizes, batches/sec, and input queue sizes. This helps with tuning
workersandbulk_max_sizeto avoid filling up the queues.For the input queue metrics, we currently only have this data on the
logs-elastic_agent.*beat-*data streams, rather than on themetrics-*data streams. Fixing this requires some fixes in Agent and I'd like to get value out on this sooner, so I'm deciding to map these fields for now onlogsand we'll fix later (opened elastic/elastic-agent#3334) on a future Agent version.@elastic/elastic-agent-data-plane I would like confirmation that I am interpreting this metric fields correctly.
Checklist
changelog.ymlfile.How to test this PR locally
elastic-package stack up && elastic-package build && elastic-package installGo to Fleet -> click on an Agent -> View more agent metrics
Related issues
Screenshots
Output write batches/sec
Output batch size by beat type
Queue depth by input