Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Remove the check for a configured Elasticsearch output when setting up global Elasticsearch connection callbacks. When a Beat is started under the V2 agent, it no longer has or reads the default configuration file that configures an Elasticsearch output on localhost. This has the consequence that the global "OnConnect" Elasticsearch callbacks never get registered, one of which fetches the cluster UUID which is a dependency of the Metricbeat beat monitoring module used by agent. In V2 the initial output configuration is sent sometime after startup via the control protocol. Since the callbacks here are just added to a global map of functions to invoke when connecting to Elasticsearch, there is actually no reason to guard them with a check for an Elasticsearch output. Bypass that to restore beat metrics collection under agent. I looked for other similar uses of b.Config access that assume a configuration file is available immediately when the Beat, and while there are a few they don't seem like they apply to running under agent. The Beats historically were able to assume they were loading a configuration file from disk, which doesn't apply anymore. (cherry picked from commit 76ea65f) Co-authored-by: Craig MacKenzie <[email protected]>
- Loading branch information