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 hard coded constraint on pipeline name for metrics #11777

Closed
wants to merge 2 commits into from
Closed
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
9 changes: 6 additions & 3 deletions x-pack/lib/monitoring/inputs/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ def fetch_global_stats
end

def extract_cluster_uuids(stats)
result = stats.extract_metrics([:stats, :pipelines, :main, :config], :cluster_uuids)
if result && !result[:cluster_uuids].empty?
cluster_uuids = result[:cluster_uuids]
cluster_uuids = agent.running_pipelines.flat_map do |_, pipeline|
next if pipeline.system?
pipeline.resolve_cluster_uuids
end.compact.uniq

if cluster_uuids.any?
@logger.info("Found cluster_uuids from elasticsearch output plugins", :cluster_uuids => cluster_uuids)
if LogStash::SETTINGS.set?("monitoring.cluster_uuid")
@logger.warn("Found monitoring.cluster_uuid setting configured in logstash.yml while using the ones discovered from elasticsearch output plugins, ignoring setting monitoring.cluster_uuid")
yaauie marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion x-pack/lib/monitoring/inputs/timer_task_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update(run_at, result, exception)
if exception.is_a?(Concurrent::TimeoutError)
logger.debug("metric shipper took too much time to complete", :exception => exception.class, :message => exception.message)
else
logger.error("metric shipper exception", :exception => exception.class, :message => exception.message)
logger.error("metric shipper exception", :exception => exception.class, :message => exception.message, :backtrace => exception.backtrace)
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion x-pack/qa/integration/monitoring/direct_shipping_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# you may not use this file except in compliance with the Elastic License.

require_relative "../spec_helper"
require 'securerandom'

describe "Direct shipping" do

Expand All @@ -13,7 +14,7 @@

config = "input { generator { count => 100 } tcp { port => 6000 } } output { null {} }"

@logstash_service = logstash_with_empty_default("bin/logstash -e '#{config}' -w 1", {
@logstash_service = logstash_with_empty_default("bin/logstash -e '#{config}' -w 1 --pipeline.id #{SecureRandom.hex(8)}", {
:settings => {
"monitoring.enabled" => true,
"monitoring.elasticsearch.hosts" => ["http://localhost:9200", "http://localhost:9200"],
Expand Down