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

Filebeat inputv2 integration #19686

Merged
merged 1 commit into from
Jul 7, 2020
Merged

Conversation

urso
Copy link

@urso urso commented Jul 6, 2020

  • Enhancement

What does this PR do?

This change integrates the v2 input API with the existing filebeat
architecture. The log input and the v2 architecure both use the
statestore as a common storage for read-states between restarts.
The integration wraps the input v2 API into a RunnerFactory, such that
new inputs are automatically available to config file relading,
autodiscovery, and fleet.

Note: this PR does not introduce or link any input yet.

The full list of changes will include:

Why is it important?

Add support for running v2 inputs in Filebeat and Agent.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

@urso urso added review Filebeat Filebeat needs_backport PR is waiting to be backported to other branches. [zube]: In Review Project:Filebeat-Input-v2 Team:Services (Deprecated) Label for the former Integrations-Services team v7.9.0 labels Jul 6, 2020
@urso urso requested a review from kvch July 6, 2020 21:16
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 6, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 6, 2020
This change integrates the v2 input API with the existing filebeat
architecture. The log input and the v2 architecure both use the
statestore as a common storage for read-states between restarts.
The integration wraps the input v2 API into a RunnerFactory, such that
new inputs are automatically available to config file relading,
autodiscovery, and fleet.

Note: this PR does not introduce or link any input yet.

The full list of changes will include:
- Introduce v2 API interfaces
- Introduce [compatibility layer](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/compat) to integrate API with existing functionality
- Introduce helpers for writing [stateless](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/input/v2/input-stateless/stateless.go) inputs.
- Introduce helpers for writing [inputs that store a state](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/input-cursor) between restarts.
- Integrate new API with [existing inputs and modules](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/beater/filebeat.go#L301) in filebeat.
@urso urso force-pushed the filebeat-inputv2-integration branch from 21adcab to 1820e36 Compare July 6, 2020 21:52
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 6, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19686 updated]

  • Start Time: 2020-07-06T21:53:19.469+0000

  • Duration: 56 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 4202
Skipped 677
Total 4879


func init() {
// Filebeat build the beat root command for executing filebeat and it's subcommands.
func Filebeat(inputs beater.PluginFactory) *cmd.BeatsRootCmd {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am on the fence about this change. The code itself is better. I am just a bit disappointed that the consistency over different beats cmd/root.go files are gone. But I guess I can live with that. :D

Copy link
Author

Choose a reason for hiding this comment

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

yeah, don't like it either. This last integration step is kinda ugly TBH. But trying to not use globals and x-pack filebeat relying on globals kinda forced me to do this. Long term I think libbeat/cmd and the <beats>/cmd packages will be removed.

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.

YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY!

@urso urso merged commit bce6dea into elastic:master Jul 7, 2020
@urso urso deleted the filebeat-inputv2-integration branch July 7, 2020 12:27
@urso urso removed the needs_backport PR is waiting to be backported to other branches. label Jul 8, 2020
urso pushed a commit to urso/beats that referenced this pull request Jul 8, 2020
urso pushed a commit that referenced this pull request Jul 9, 2020
@urso urso added test-plan Add this PR to be manual test plan skip-test-plan and removed test-plan Add this PR to be manual test plan labels Jul 14, 2020
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Filebeat Filebeat Project:Filebeat-Input-v2 review skip-test-plan Team:Services (Deprecated) Label for the former Integrations-Services team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants