Skip to content

Conversation

@edmocosta
Copy link
Contributor

Proposed commit message

This PR implements the logstash exporter logic, which includes:

  • Batch creation from the plog data.
  • Feed the logstash client workers queue.
  • Wait and process the batch results, handling client retries (re-submitting the batch to the workers queue, as the backoff delay is already applied by the clients).
  • Return a proper result to otelconsumer.

A few considerations:

  • The exporter's ConsumeLogs response is sync, and it returns to the actual batch processing results, so the otelconsumer outcome is correct.
  • The workers queue is sized as the the number of outputs.Client created by the otelconsumer, which given the sync ConsumeLogs nature, should be enough. A few adjusts might be necessary after benchmarking it, but it's not an issue at the moment.
  • When the batch is dropped internally on the exporter, it returns a consumererror.NewPermanent, which leads the otelconsumer to also drop the batch on the beats side. Besides that, all other flow errors are being wrapped into consumererror.NewLogs.

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

How to test this PR locally

Run am agent filebeat in OTel mode, adding on the pipeline a logstash output configuration.

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 19, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @edmocosta? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@edmocosta edmocosta marked this pull request as ready for review September 22, 2025 15:07
@edmocosta edmocosta requested review from a team as code owners September 22, 2025 15:07
@edmocosta edmocosta added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 22, 2025
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 22, 2025
@leehinman leehinman self-requested a review September 23, 2025 13:03
@edmocosta
Copy link
Contributor Author

edmocosta commented Sep 25, 2025

@elastic/beats-tech-leads could you please take a look at it so we can merge it?

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.

Approving go.mod changes

@kaisecheng kaisecheng merged commit ff13c7f into elastic:main Sep 25, 2025
207 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants