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

Allow to pass config overrides via the Settings Struct #8449

Merged
merged 3 commits into from
Sep 28, 2018

Conversation

ph
Copy link
Contributor

@ph ph commented Sep 26, 2018

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

Notes: this part of the code is pretty hard to unit test, we have to do some refactoring to make it happen :(

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.
@ph ph mentioned this pull request Sep 26, 2018
@ph ph added in progress Pull request is currently in progress. and removed review labels Sep 26, 2018
@ph ph added review and removed in progress Pull request is currently in progress. labels Sep 26, 2018
@ph ph requested a review from kvch September 27, 2018 12:34
Copy link
Contributor

@kvch kvch left a comment

Choose a reason for hiding this comment

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

Great addition!

@ph ph added the needs_backport PR is waiting to be backported to other branches. label Sep 28, 2018
@ph
Copy link
Contributor Author

ph commented Sep 28, 2018

This will need to go in 6.5 for beatless.

@ph ph merged commit 4a03bb3 into elastic:master Sep 28, 2018
ph added a commit to ph/beats that referenced this pull request Oct 1, 2018
* Allow to pass config overrides via the Settings Struct

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

(cherry picked from commit 4a03bb3)
@ph ph added v6.5.0 and removed needs_backport PR is waiting to be backported to other branches. labels Oct 1, 2018
@ph ph mentioned this pull request Oct 2, 2018
ph added a commit that referenced this pull request Oct 4, 2018
* Allow to pass config overrides via the Settings Struct

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

(cherry picked from commit 4a03bb3)
ph added a commit that referenced this pull request Oct 24, 2018
Cherry-pick of PR #8485 to 6.x branch. Original message: 

## This PR 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.
11. Types to validate value from the users and the lambda function.

## What it doesn't provides

- ECS and full event extraction. (NOT for v1)
- 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.
- Concurrency / memory settings

## Vendored

- aws/aws-lambda-go
- aws/aws-sdk-go-v2

---

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

```
# Disable anything that could be send to disk
path.data: /tmp
path.logs: /tmp/logs
logging.to_stderr: true
logging.to_files: false
#logging.level: debug
setup.template.enabled: true
queue.mem:
  events: 50
  flush.min_events: 1
  flush.timeout: 0.5s
```

## related work
- #8449
- #8443
ph added a commit to ph/beats that referenced this pull request Oct 30, 2018
* Allow to pass config overrides via the Settings Struct

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

(cherry picked from commit 4a03bb3)
@ph ph added the v6.4.3 label Oct 30, 2018
ph added a commit that referenced this pull request Oct 30, 2018
…ings Struct (#8815)

Cherry-pick of PR #8449 to 6.4 branch. Original message: 

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

**Notes:** this part of the code is pretty hard to unit test, we have to do some refactoring to make it happen :(
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…he Settings Struct (elastic#8815)

Cherry-pick of PR elastic#8449 to 6.4 branch. Original message: 

Sometime a custom beat that get executed want to override system
defaults instead of relying on code defined by libbeat.

This is the case with beatless, the queue has limits and flush values
that make sense when the beat is run on the edge but not on on AWS lambda.

Note that settings is passed via liberal common.Config no type checking is
done. I went that route because many parts of beats doesn't expose the
config struct outside of the package.

This is similar to explicitely defining them in the yaml.

**Notes:** this part of the code is pretty hard to unit test, we have to do some refactoring to make it happen :(
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.

2 participants