-
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
Unify event, data and state handling in filebeat #4171
Conversation
jenkins, retest it |
The data and event handling has grown over time in filebeat. One the one hand meta data and event data was mixed and different structure to handle the data existed. The structures which existed were focused in the log prospector. This change brings a unified data handling with a data object which separates event, meta data and state. This new model should allow to add new prospector types and use the same data objects. The reason it ended up in `util` package is because `data` is taken by the data folder and `common` would lead to too many conflicts with `common` package in libbeat.
@@ -42,7 +42,7 @@ func (o *Outlet) SetSignal(signal <-chan struct{}) { | |||
o.signal = signal | |||
} | |||
|
|||
func (o *Outlet) OnEvent(event *input.Data) bool { | |||
func (o *Outlet) OnEvent(data *util.Data) bool { |
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.
[golint] reported by reviewdog 🐶
exported method Outlet.OnEvent should have comment or be unexported
"github.com/elastic/beats/libbeat/common" | ||
) | ||
|
||
type Data 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.
[golint] reported by reviewdog 🐶
exported type Data should have comment or be unexported
Meta Meta | ||
} | ||
|
||
type Meta 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.
[golint] reported by reviewdog 🐶
exported type Meta should have comment or be unexported
Module string | ||
} | ||
|
||
func NewData() *Data { |
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.
[golint] reported by reviewdog 🐶
exported function NewData should have comment or be unexported
The data and event handling has grown over time in filebeat. One the one hand meta data and event data was mixed and different structure to handle the data existed. The structures which existed were focused in the log prospector. This change brings a unified data handling with a data object which separates event, meta data and state. This new model should allow to add new prospector types and use the same data objects.
The reason it ended up in
util
package is becausedata
is taken by the data folder andcommon
would lead to too many conflicts withcommon
package in libbeat.