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

Cherry-pick #8023 to 6.x: Heartbeat Automatic Reload #8315

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

andrewvc
Copy link
Contributor

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:

  1. Adds a monitors.configuration option, that enables reloading individual monitor YAML blocks from a directory (monitors.d/*.yml by default).
  2. Removes the poll_file functionality
  3. Significantly refactors the monitor manager to accomplish this
  4. Cleans up the naming of some core data-structures and flow of management operations.

This 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.

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 {

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{}

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() {

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() {

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

@andrewvc
Copy link
Contributor Author

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.

@andrewvc
Copy link
Contributor Author

Created a PR with those changes in #8316

@andrewvc andrewvc merged commit 2e0ec42 into elastic:6.x Sep 17, 2018
@urso urso mentioned this pull request Sep 17, 2018
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants