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

Backport PR #17185 to 8.18: Fix empty node stats pipelines #17202

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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),
: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
6 changes: 6 additions & 0 deletions qa/integration/services/monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def pipeline_stats(pipeline_id)
stats_response.fetch("pipelines").fetch(pipeline_id)
end

def pipelines_stats
resp = Manticore.get("http://localhost:#{@port}/_node/stats/pipelines").body
stats_response = JSON.parse(resp)
stats_response.fetch("pipelines")
end

def event_stats
resp = Manticore.get("http://localhost:#{@port}/_node/stats").body
stats_response = JSON.parse(resp)
Expand Down
6 changes: 6 additions & 0 deletions x-pack/qa/integration/monitoring/direct_shipping_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

include_examples "record monitoring data to es"

it "gives pipelines stats" do
api = MonitoringAPI.new
stats = api.pipelines_stats
expect(stats.keys).not_to be_nil
end

after :all do
@logstash_service.stop unless @logstash_service.nil?
@elasticsearch_service.stop unless @elasticsearch_service.nil?
Expand Down