[9.4] (backport #19091) Clear pipeline metrics when a pipeline fails to start#19120
Open
mergify[bot] wants to merge 2 commits into
Open
[9.4] (backport #19091) Clear pipeline metrics when a pipeline fails to start#19120mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
On a failed pipeline start, `Create#execute` now calls `new_pipeline.shutdown` to clear plugin/events/flow/batch metrics. Without this, retries under `config.reload.automatic: true` leaked metric entries into `_node/stats`. Closes #19009 (cherry picked from commit d583fb7) # Conflicts: # logstash-core/lib/logstash/pipeline_action/create.rb
Contributor
Author
|
Cherry-pick of d583fb7 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Contributor
🤖 GitHub commentsJust comment with:
|
6 tasks
💛 Build succeeded, but was flaky
Failed CI Steps
History
cc @kaisecheng |
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
Fixes a metric leak in
_node/statswhen a pipeline repeatedly fails to start withconfig.reload.automatic: true. Previously, each retry left a fresh set of plugin metric entries in the collector, causing the stats payload to grow indefinitely.What does this PR do?
When
Create.executefails, it now callsnew_pipeline.shutdownto clean up pipeline metrics.ReloadandRecoverare unchanged. Both already invokeold_pipeline.shutdownbefore retrying, so they inherit the cleanup.Checklist
Author's Checklist
How to test this PR locally
curl -s http://localhost:9600/_node/stats/pipelines/mainExpected:
codecsstays at 0–2 regardless of how highfailuresclimbs. Total_node/statspayload size stays roughly constant (a few KB) instead of growing linearly with retries.Related issues
_node/statswhen a pipeline fails to start withconfig.reload.automatic: true#19009This is an automatic backport of pull request Clear pipeline metrics when a pipeline fails to start #19091 done by Mergify.