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

[WIP] Migrate to the new registry #7803

Closed
wants to merge 61 commits into from
Closed

Conversation

ph
Copy link
Contributor

@ph ph commented Jul 30, 2018

Related PR for the documentation: #7392

Migration:

  • Feature now supports details
  • codecs
  • processors
  • queues
  • output
  • filebeat's input
  • go-plugins uses the Bundleable interface
  • Registry wrapper for Metricbeat
  • Registry wrapper for hearthbeat
  • Migrate packetbeat to the new registry

Notes TBD in another PR.:

  • Move All metricbeat plugins
  • Move All heartbeat plugins
  • Move All Auditbeat plugins
  • Update filebeat generator.

ph added 30 commits July 27, 2018 18:03
Use a global registry and the feature bundle.
Since a go plugin only works with a specific of golang and beats we
can change the return value without changing the signature.
The autodiscovery feature was defining 3 customs registry, this PR do
the following:

- Provider, Appender and Builder now users the feature registry.
- It move the Factory type into their right package.
- Config are now inside their own package.
- Use the same naming for finding factories and building object.
- type aliasing is in place to make the transition smoother for types.
- A shim is in place that will proxy the registry of plugin to the
global registry.
- package.Plugin methods are now returning a feature instead of a
hashmap.
// feature are grouped by namespace, a namespace is a kind of plugin like outputs, inputs, or queue.
// The feature name must be unique.
type registry struct {
type FeatureRegistry struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type name will be used as feature.FeatureRegistry by other packages, and that stutters; consider calling this Registry

// feature are grouped by namespace, a namespace is a kind of plugin like outputs, inputs, or queue.
// The feature name must be unique.
type registry struct {
type FeatureRegistry struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type name will be used as feature.FeatureRegistry by other packages, and that stutters; consider calling this Registry


type Registrar struct {
modules map[string]entry
type TaskRunner interface {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type TaskRunner should have comment or be unexported

@elastic elastic deleted a comment from houndci-bot Aug 1, 2018

var Registry = newRegistrar()
type JobRunner func() (beat.Event, []JobRunner, error)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type JobRunner should have comment or be unexported

@ph ph changed the title [WIP] Feature/new registry [WIP] Migrate to the new registry Aug 1, 2018
@ph ph changed the base branch from master to feature-beatless August 30, 2018 20:13
@ph ph changed the base branch from feature-beatless to master August 30, 2018 20:14
@ph
Copy link
Contributor Author

ph commented Jan 7, 2019

I am closing this and will reopen a new one.

@ph ph closed this Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Pull request is currently in progress. libbeat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants