Skip to content

Conversation

jordivilaseca
Copy link
Contributor

@jordivilaseca jordivilaseca commented Aug 13, 2025

Description

When a request to the EventsAPI exceeds 10 MB, split it into N smaller requests, each no larger than 10 MB.

If any of these requests fail, data processing stops and an at-most-once delivery approach is followed:

  • If at least one request succeeds: return a permanent error to prevent data duplication.
  • If no request succeeds: return the error from the first request, following the original error retry policy.

This change ensures that large requests (≥ 10 MB) do not result in complete data loss. Some data may still be lost because processing halts after the first failure, but this can be improved later by returning the missing data via consumererror.Trace and derivatives, allowing the collector to retry (out of the scope for this PR).

Link to tracking issue

Fixes #41782

Testing

Tested were added to ensure that the at-most-once delivery approach is followed

Documentation

@jordivilaseca jordivilaseca force-pushed the exporter-tinybird-limit-requests-to-10mb branch from 62d8c4b to 80357cd Compare August 19, 2025 09:03
type option func(*tinybirdExporter) error

// withMaxRequestBodySize sets the maximum size of the request body in bytes.
func withMaxRequestBodySize(size int) option {
Copy link
Member

Choose a reason for hiding this comment

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

This seems like isn't applied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only used in tests to verify that the request size limit works as expected, but it is not exposed to the user. The main reason for this is that the EventsAPI has a hard limit that has not changed for a long time, and it is not expected to change in the future.

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

approved by codeowner - @dmitryax please take another look

@MoreraAlejandro
Copy link
Contributor

Is there something in our side that we should take care of @atoulme ? or should we just wait for @dmitryax review?

@atoulme atoulme merged commit 7c8407f into open-telemetry:main Sep 6, 2025
212 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 6, 2025
@atoulme
Copy link
Contributor

atoulme commented Sep 6, 2025

Is there something in our side that we should take care of @atoulme ? or should we just wait for @dmitryax review?

Given it's been a bit, I have gone and merged this PR, and we can address followups if any in issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[exporter/tinybird] Limit EventsAPI requests to 10MB

5 participants