-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Metricbeat logstash
module: accept override cluster UUID from Logstash
#15795
Conversation
Pinging @elastic/stack-monitoring (Stack monitoring) |
Logstash pipelines are more or less independent entities (unless one forwards between pipelines). Don't we want pipeline 1 be reported with cluster 1, and pipeline 2 with cluster 2? This changes looks like all pipelines will now be reported with cluster 1 only. |
@urso Yeah, we can do that. We can invert the logic to let the pipeline's cluster UUID (if set) to override the global one. I'll make the change. Thanks! |
ae540d0
to
e656ba0
Compare
@urso I've made the change you suggested. Thanks! |
jenkins, test this |
dc9e5de
to
9f62931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested manually and getting the following output:
➜ metricbeat git:(mb-ls-xp-cluster-uuid) ✗ ./metricbeat | jq -c 'select(.service.type == "logstash") | .type,.cluster_uuid'
"logstash_state"
"foobar"
"logstash_stats"
"foobar"
"logstash_state"
"foobar"
"logstash_state"
"foobar"
"logstash_stats"
"foobar"
"logstash_state"
"foobar"
"logstash_state"
"foobar"
"logstash_state"
"foobar"
…ash (#15795) (#16105) * Fetch override cluster UUID from Logstash node pipelines API and use it * Parse override cluster UUID from Logstash API response and make node_stats use it * Adding CHANGELOG entry * Use override cluster UUID as fallback to ES vertex cluster UUID * Fixing CHANGELOG entry language * Adding godoc for new helper function
What does this PR do?
This PR teaches the
logstash
Metricbeat module to accept an optional overridecluster_uuid
field from Logstash APIs called by the module.If the Logstash pipeline being monitored by this module has an Elasticsearch plugin vertex in it, the cluster UUID associated with that vertex will be used. If no such vertex is found, the override cluster UUID will be used.
Why is it important?
See #15772.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesHow to test this PR locally
Configure Logstash to use an override cluster_uuid for monitoring. To do this, add this line to your
config/logstash.yml
:Start a simple pipeline in Logstash.
Enable the
logstash-xpack
module in Metricbeat. This will enable thelogstash
module with the required configuration for Stack Monitoring.For easy inspection of generated events, disable the
elasticsearch
output and enable theconsole
output in Metricbeat. To do this, edit yourmetricbeat.yml
file and setoutput.elasticsearch.enabled: false
andoutput.console.enabled: true
.Run Metricbeat and check that the generated Logstash Stack Monitoring events of
type:logstash_state
andtype:logstash_stats
both have a top-level field ofcluster_uuid
with the same value as set in the Logstash configuration file.Related issues