mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
8fd6e58e78
commit
592591bae9
2 changed files with 8 additions and 4 deletions
|
@ -24,10 +24,9 @@ module LogStash
|
|||
end
|
||||
end
|
||||
|
||||
def pipeline(pipeline_id)
|
||||
extract_metrics(
|
||||
def pipeline(pipeline_id, options={})
|
||||
metrics = extract_metrics(
|
||||
[:stats, :pipelines, pipeline_id.to_sym, :config],
|
||||
:graph,
|
||||
:ephemeral_id,
|
||||
:hash,
|
||||
:workers,
|
||||
|
@ -39,6 +38,10 @@ module LogStash
|
|||
:dead_letter_queue_path,
|
||||
:cluster_uuids
|
||||
).reject{|_, v|v.nil?}
|
||||
if options.fetch(:graph, false)
|
||||
metrics.merge!(extract_metrics([:stats, :pipelines, pipeline_id.to_sym, :config], :graph))
|
||||
end
|
||||
metrics
|
||||
rescue
|
||||
{}
|
||||
end
|
||||
|
|
|
@ -28,7 +28,8 @@ module LogStash
|
|||
|
||||
get "/pipelines/:id" do
|
||||
pipeline_id = params["id"]
|
||||
payload = node.pipeline(pipeline_id)
|
||||
opts = {:graph => as_boolean(params.fetch("graph", false))}
|
||||
payload = node.pipeline(pipeline_id, opts)
|
||||
halt(404) if payload.empty?
|
||||
respond_with(:pipelines => { pipeline_id => payload } )
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue