-
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
Move HTTP calls to Logstash from New() to Fetch() #15306
Conversation
Pinging @elastic/stack-monitoring (Stack monitoring) |
|
||
m.HTTP.SetURI(m.HTTP.GetURI() + "?vertices=true") | ||
} | ||
|
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.
@ycombinator The two init function looks really close to me could it be possible to move them to the logstash package and use the same?
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.
@ph I extracted much of the common code into the logstash
package. Please take a look at let me know what you think. Thanks!
LGTM |
CI failures are unrelated. Merging. |
Manual testing passed (BC1). Metricbeat survived taking down logstash. Noticed expected errors while restarting:
|
…astic#15323) * node_stats: move HTTP calls from New() to Fetch() * node: move HTTP calls from New() to Fetch() * Adding CHANGELOG entry * Refactoring: extract common code into logstash package * Unexporting getVersion
Resolves #15276.
This PR makes the
logstash/node
andlogstash/node_stats
metricsets resilient to Logstash's unavailability.Before this PR, if Logstash was not already running when Metricbeat was started up with the
logstash-xpack
module enabled, Metricbeat would immediately exit with an error since Logstash was unreachable.With this PR, Metricbeat will keep running and retrying to reach Logstash periodically. This also allows Logstash to go away temporarily (say, for an upgrade) and keeps Metricbeat running.
Testing this PR
Build Metricbeat with this PR.
Enable the
logstash-xpack
module.Start up Metricbeat (without starting up Logstash).
Note that there are errors in the Metricbeat log about it not being able to connect to Logstash's APIs. But also ensure that Metricbeat keeps running.
Start up Logstash.
Check the Metricbeat log again. Ensure that eventually (< 1 minute), the connection errors go away.
Ensure that a
.monitoring-logstash-*-mb-*
index for today's date exists. Ensure that it contains recent (timestamp
within last 20 seconds) documents oftype:logstash_stats
. Ensure that it contains exactly one document per Logstash pipeline oftype:logstash_state
(a new document is created per pipeline, per Logstash node (re)start).Stop Logstash.
Repeat steps 4-7.