Skip to content
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

Fix empty node stats pipelines #17185

Merged
merged 2 commits into from
Feb 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions logstash-core/lib/logstash/api/commands/stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def report(stats, extended_stats = nil, opts = {})
:reloads => stats[:reloads],
:queue => stats[:queue],
:pipeline => {
:workers => stats[:config][:workers],
:batch_size => stats[:config][:batch_size],
:batch_delay => stats[:config][:batch_delay],
:workers => stats.dig(:config, :workers),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the bug before was indexing a nil class? In the case we dont have data here should we remove nils from the map? Should we default to an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was nil. All other fields in this pipeline are not showing any meaningful data, it only gives empty array or null. This monitoring feature is deprecated for years. I think we have good enough reason to not set a default value here and just show null

:batch_size => stats.dig(:config, :batch_size),
:batch_delay => stats.dig(:config, :batch_delay),
}
}
ret[:dead_letter_queue] = stats[:dlq] if stats.include?(:dlq)
Expand Down