-
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
Cherry-pick #8023 to 6.x: Heartbeat Automatic Reload #8315
Conversation
Add automatic reloading for heartbeat config files. This deprecates the `watch.poll_file` options. This patch also fixes a potential source of races in code using `cfgfile/Runner` by making that interface implement `Stringer`, the reason being that by default `cfgfile/Runner` can recursively print the backing structure, which can trigger a race. (cherry picked from commit 037a4f2)
return fmt.Sprintf("Monitor not loaded, plugin is disabled") | ||
} | ||
|
||
type MonitorPluginInfo struct { |
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.
exported type MonitorPluginInfo should have comment or be unexported
"github.com/elastic/beats/libbeat/common" | ||
) | ||
|
||
type PluginDisabledError struct{} |
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.
exported type PluginDisabledError should have comment or be unexported
} | ||
} | ||
|
||
func (m *Monitor) Stop() { |
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.
exported method Monitor.Stop should have comment or be unexported
return nil | ||
} | ||
|
||
func (m *Monitor) Start() { |
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.
exported method Monitor.Start should have comment or be unexported
Hmmm, I don't know why these hound errors weren't in the original PR. I'd prefer to merge this as is to keep the diff as close to #8023 as possible, and fix these issues in a subsequent PR. |
Created a PR with those changes in #8316 |
Cherry-pick of PR #8023 to 6.x branch. Original message:
This WIP patch brings heartbeat automatic reloading in-line with other Beats, using the standard reload feature. It is not yet ready for any sort of review. I'm mostly posting this to get CI running on it. This patch:
monitors.configuration
option, that enables reloading individualmonitor
YAML blocks from a directory (monitors.d/*.yml
by default).poll_file
functionalityThis is currently a WIP, it definitely needs a good number more tests.
This will be a significant breaking change due to the removal of poll file functionality, but since heartbeat is still in beta, we can and should do this due to the non-standard nature of the
poll_file
.