-
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
Initial version of beatless #8437
Conversation
// 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 { |
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.
type name will be used as feature.FeatureRegistry by other packages, and that stutters; consider calling this Registry
@@ -28,26 +28,26 @@ import ( | |||
|
|||
type mapper map[string]map[string]Featurable | |||
|
|||
// Registry implements a global registry for any kind of feature in beats. | |||
// Registry implements a global FeatureRegistry for any kind of feature in beats. |
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.
comment on exported type FeatureRegistry should be of the form "FeatureRegistry ..." (with optional leading article)
Forgot about the license check, working on fixing that. |
x-pack/beatless/beater/beatless.go
Outdated
|
||
// TODO: Add registry reference here. | ||
// Beatless is a beat designed to un under a serverless environment and listen to external triggers, |
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.
tyop: "to run"
x-pack/beatless/beater/beatless.go
Outdated
// Beatless is a beat designed to un under a serverless environment and listen to external triggers, | ||
// each invocation will generate one or more events to Elasticsearch. | ||
// | ||
// Each serverless implementation is different but beatless follows a few executions rules. |
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.
tyop: execution
x-pack/beatless/beater/beatless.go
Outdated
return nil, fmt.Errorf("error reading config file: %v", err) | ||
c := &config.DefaultConfig | ||
if err := cfg.Unpack(c); err != nil { | ||
return nil, fmt.Errorf("xerror reading config file: %v", err) |
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.
xerror? is this a typo?
x-pack/beatless/core/coordinator.go
Outdated
return &Coordinator{log: log, runners: runners} | ||
} | ||
|
||
// Start starts each functions into an independant goroutine and wait until all the goroutine are |
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.
tyop: independent
x-pack/beatless/core/coordinator.go
Outdated
|
||
// Start starts each functions into an independant goroutine and wait until all the goroutine are | ||
// stopped to exit. | ||
func (r *Coordinator) Start(ctx context.Context) error { |
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.
I would rather name this function Run
. Start
implies there is a Stop
function to call.
@ph One idea to make this more reviewable and not have to tell Github which files it should expand and which ones not: Could you open a PR with just the dependency against the feature branch and then rebase this one on top of it when it's merged? |
x-pack/beatless/provider/registry.go
Outdated
) | ||
|
||
// namespace is the namespace were providers will be registered in the global registry. | ||
var namespace = "beatless.provider" |
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.
This could be const
.
x-pack/beatless/provider/feature.go
Outdated
// ns return the namespace for functions of a specific provider. The registry have a flat view | ||
// representation of the plugin world this mean we don't really have a tree, instead what we do is | ||
// to create a unique keys per providers that will only keep the functions of the provider. | ||
func ns(provider string) string { |
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.
Please rename this function to getNamespace
or something more descriptive.
} | ||
|
||
// defensive checks | ||
if len(parsedEvent.LogEvents) == 0 { |
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.
Why is it invalid to get no events?
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.
I've looked at the SDK; this cannot happen the function should not be invoked in that case. I've removed the defensive check for all the function types.
fd0a33e
to
533ba8c
Compare
This provide the following: 1. Plugin infra for developing providers and functions 2. A local stdin provider only used for testing, I will remove it in the final version. 3. AWS provider and function types for: - Cloudwatch logs - SQS - Kinesis - Api web gateway proxy 4. License checker 5. Packaging of artifact 6. Runners 7. CLI infrastructure 8. CLI to push a cloudwatch logs function. 9. CLI to delete any function 10. Processors support. What it doesn't provides: - ECS and full event extraction. - Specifying the AWS credentials in the configuration - CLI for SQS, Kinesis, API - Robust CLI interaction with the API, rollback on failure / versioning. - Removal of not supported outputs - Removal of seccomp check - Integration tests - Updated build task to produce containing the user executable beat and the linux beats. Vendored: - https://github.com/aws/aws-lambda-go - https://github.com/aws/aws-sdk-go-v2
When a project had two licenses, the script was creating two entries in the NOTICE.txt but both entries would share the same license. This commit also add the possibility to skip file that start with LICENSE but doesn't contains any license information. It also add MIT-0 license wording see https://github.com/aws/mit-0
d33f5b7
to
40c4536
Compare
Rebased + first round of comments fixed, I am waiting on merging #8483 |
This PR provide the following
final version.
What it doesn't provides
the linux beats.
Vendored
Note: The PR look much bigger because of the vendored files.
Notes 2:
Make sure you add this to your config YAMl, I wan't to make the following the default options but it would have been really messy to do it in this PR.
related work