Skip to content

[9.0](backport #46413) otel: add test for otelconsumer + elasticsearchexporter document-level retries#46617

Merged
mauri870 merged 5 commits into9.0from
mergify/bp/9.0/pr-46413
Oct 15, 2025
Merged

[9.0](backport #46413) otel: add test for otelconsumer + elasticsearchexporter document-level retries#46617
mauri870 merged 5 commits into9.0from
mergify/bp/9.0/pr-46413

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Sep 12, 2025

Proposed commit message

This commit adds a test to verify that elasticsearchexporter applies
document-level retries correctly, and that the combination of
otelconsumer and the exporter guarantees at-least-once delivery when
a batch is acknowledged.

The test simulates retryable and permanent errors, checks that
max_retries is respected, and ensures that documents retried after
temporary failures are ingested while permanent failures are dropped.

Currenty, otelconsumer output metrics are not tracked correctly, and it
will always ACK the whole batch even if there were retries or dropped
events by the exporter.

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.

How to test this PR locally

$ cd x-pack/filebeat
$ mage buildSystemTestBinary
$ go test -run ^TestFilebeatOTelDocumentLevelRetries$ -v -count=1 -tags=integration ./tests/integration
$ ./script/stresstest.sh --tags integration ./x-pack/filebeat/tests/integration ^TestFilebeatOTelDocumentLevelRetries$ -p 1
10m20s: 30 runs so far, 0 failures, 1 active
10m25s: 30 runs so far, 0 failures, 1 active

Related issues

…l retries (#46413)

* otel: add test for document-level retries

* fix linter errors

* add dummy assert for dropped events

* use deterministic handler from mock-es

* assert mock-es metrics

* sync go.mod and go.sum

* simplify handler logic

* update comments

* use slices.Contains

* go get mock-es latest

(cherry picked from commit 2948886)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	x-pack/filebeat/tests/integration/otel_test.go
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Sep 12, 2025
@mergify mergify Bot requested review from a team as code owners September 12, 2025 19:56
@mergify mergify Bot removed the request for review from a team September 12, 2025 19:56
@mergify mergify Bot requested review from faec and leehinman September 12, 2025 19:56
@mergify mergify Bot added the backport label Sep 12, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 12, 2025

Cherry-pick of 2948886 has failed:

On branch mergify/bp/9.0/pr-46413
Your branch is up to date with 'origin/9.0'.

You are currently cherry-picking commit 29488865a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	both modified:   x-pack/filebeat/tests/integration/otel_test.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Sep 12, 2025
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 12, 2025
@github-actions github-actions Bot added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 12, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 12, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 15, 2025

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

4 similar comments
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 22, 2025

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Sep 29, 2025

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Oct 6, 2025

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Oct 13, 2025

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

@pierrehilbert
Copy link
Copy Markdown
Contributor

@mauri870 could you please resolve the conflicts?

@mauri870
Copy link
Copy Markdown
Member

Depends on the following backport #47089.

@mauri870 mauri870 enabled auto-merge (squash) October 15, 2025 15:46
@mauri870 mauri870 merged commit 46caac3 into 9.0 Oct 15, 2025
26 of 29 checks passed
@mauri870 mauri870 deleted the mergify/bp/9.0/pr-46413 branch October 15, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request 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.

3 participants