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

Add filebeat receiver and otel consumer output #40974

Merged
merged 9 commits into from
Sep 26, 2024

Conversation

leehinman
Copy link
Contributor

Proposed commit message

This PR adds a filebeat receiver and an otelconsumer output. These can be used together to run filebeat as an otel receiver.

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.

Disruptive User Impact

None

Author's Checklist

  • [ ]

How to test this PR locally

receiver_test.go shows how receiver is created, started and stopped.

factories.Receivers, err = receiver.MakeFactoryMap(
                fbreceiver.NewFactory(),
        )

could be used in the opentelemetry collector to add the filebeat receiver.

Configuration would look like:

receivers:
  filebeatreceiver:
    filebeat:
      inputs:
        - type: benchmark
          enabled: true
          message: "test"
		  eps: 5
    output:
      otelconsumer:
    logging:
      level: debug
      selectors:
        - '*'
    processors:
      - add_fields:
          target: project
          fields:
            name: myproject
processors:
  batch:
exporters:
  debug:
    verbosity: detailed
    sampling_initial: 100
service:
  pipelines:
    logs:
      receivers: [filebeatreceiver]
      processors: [batch]
      exporters: [debug]

Related issues

Use cases

Screenshots

Logs

@leehinman leehinman added enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-8.x Automated backport to the 8.x branch with mergify labels Sep 24, 2024
@leehinman leehinman requested review from a team as code owners September 24, 2024 19:07
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 24, 2024
Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

I think adding more to the validation for the configuration would be nice to have. Like validating that the only output configured is the otelconsumer. Possibly injecting an the otelconsumer in the case that it was not defined in the configuration.

But I don't want to block on that here, as I think we can keep iterating. Lets get this merged so we can start testing.

x-pack/filebeat/fbreceiver/config.go Outdated Show resolved Hide resolved
x-pack/filebeat/fbreceiver/config.go Outdated Show resolved Hide resolved
@cmacknz
Copy link
Member

cmacknz commented Sep 24, 2024

If this is blocking further progress I am OK approving this without additional tests, but let's track the need for more testing in a GH issue first so we don't just forget to do it.

@blakerouse
Copy link
Contributor

@cmacknz Definitely want to get this merged now, so we can get this being used by elastic-agent. I agree that more unit testing in that area would be good, but shouldn't block this PR. I filed this issue to track the additional coverage - #40977

Integration testing in elastic-agent will also be added for more coverage.

@blakerouse
Copy link
Contributor

@cmacknz Looks like this needs a @elastic/beats-tech-leads review to get this merged.

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Approved to unblock

@mauri870
Copy link
Member

Codewise looks good, eager to have all the pieces together!

@leehinman leehinman enabled auto-merge (squash) September 25, 2024 23:19
@leehinman leehinman merged commit 8b93e1c into elastic:main Sep 26, 2024
142 checks passed
mergify bot pushed a commit that referenced this pull request Sep 26, 2024
* Add filebeat receiver and otel consumer output

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
(cherry picked from commit 8b93e1c)

# Conflicts:
#	go.mod
leehinman added a commit that referenced this pull request Sep 27, 2024
…#40998)

* Add filebeat receiver and otel consumer output (#40974)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
(cherry picked from commit 8b93e1c)
Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
Co-authored-by: Lee E. Hinman <lee.e.hinman@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants