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

otel: add test for batch splitting with the elasticsearchexporter #6334

Closed

Conversation

mauri870
Copy link
Member

What does this PR do?

Adds a test that the elasticsearchexporter does batch splitting properly on large batches comming from a beats receiver.

Why is it important?

This guarantees that the scenario covered in elastic/beats#41911 does not happen again.

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/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues

@mauri870 mauri870 added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-changelog labels Dec 13, 2024
@mauri870 mauri870 requested a review from a team December 13, 2024 16:54
@mauri870 mauri870 self-assigned this Dec 13, 2024
@mauri870 mauri870 requested a review from a team as a code owner December 13, 2024 16:54
@mauri870 mauri870 requested review from michalpristas, blakerouse, rdner and faec and removed request for a team December 13, 2024 16:54
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

mergify bot commented Dec 13, 2024

This pull request does not have a backport label. Could you fix it @mauri870? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Dec 13, 2024

backport-v8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Dec 13, 2024
@mauri870 mauri870 force-pushed the otel-test-batcher-entity-too-large branch from d42229b to 3519ee7 Compare December 16, 2024 13:59
Copy link

@jlind23
Copy link
Contributor

jlind23 commented Dec 17, 2024

@mauri870 does this PR fixes https://github.com/elastic/ingest-dev/issues/3677? After reading the description I am not sure what the For keyword means here.

Comment on lines +1104 to +1106
// This test asserts that the batcher configuration from the elasticseachexporter
// splits batches to avoid a 413 Request Entity Too Large error from Elasticsearch.
info := define.Require(t, define.Requirements{
Copy link
Member

Choose a reason for hiding this comment

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

Just double checking why we need this to be an integration test that runs the entire collector. What additional test coverage is this adding? Why can't this be covered by a unit test in the exporter?

I like integration tests, they catch a lot of problems, but they are also driving our CI execution time to infinity :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, I think this is better suited to be in the exporter. Actually, it might as well be covered in the exporter already by open-telemetry/opentelemetry-collector-contrib#36396. I will double check.

@mauri870
Copy link
Member Author

@mauri870 does this PR fixes elastic/ingest-dev#3677? After reading the description I am not sure what the For keyword means here.

"For" in this context means "Relates to" that issue. Unfortunately the issue is an umbrella to different corner cases that need to be covered, and this PR is a test for one of them.

@mauri870 mauri870 marked this pull request as draft December 23, 2024 16:24
@mauri870
Copy link
Member Author

So I looked into the tests and the elasticsearchexporter has coverage of test options, including flush::interval and flush::bytes here, I don't think an integration test in this case adds any additional coverage.

@mauri870 mauri870 closed this Dec 23, 2024
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 skip-changelog 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.

4 participants