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

[chore] Fix bug in exporter.Request.MergeSplit() #12009

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

sfc-gh-sili
Copy link
Contributor

@sfc-gh-sili sfc-gh-sili commented Jan 3, 2025

Description

This PR fixes logsRequest, tracesRequest and metricsRequest to NOT modify the input if MergeSplit() returns an error. Copy-pasted the doc string of MergeSplit() for references:

// MergeSplit is a function that merge and/or splits this request with another one into multiple requests based on the
// configured limit provided in MaxSizeConfig.
// All the returned requests MUST have a number of items that does not exceed the maximum number of items.
// Size of the last returned request MUST be less or equal than the size of any other returned request.
// The original request MUST not be mutated if error is returned after mutation or if the exporter is
// marked as not mutable. The length of the returned slice MUST not be 0.
// Experimental: This API is at the early stage of development and may change without backward compatibility
// until #8122 is resolved.
MergeSplit(context.Context, exporterbatcher.MaxSizeConfig, Request) ([]Request, error)

Link to tracking issue

Fixes #

Testing

Added TestMergeSplit{Logs, Traces, Metrics}InputNotModifiedIfErrorReturned

Documentation

@sfc-gh-sili sfc-gh-sili requested review from bogdandrutu, dmitryax and a team as code owners January 3, 2025 21:41
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.65%. Comparing base (b4ae0ba) to head (08a3a33).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12009      +/-   ##
==========================================
+ Coverage   91.62%   91.65%   +0.02%     
==========================================
  Files         447      447              
  Lines       23737    23746       +9     
==========================================
+ Hits        21749    21764      +15     
+ Misses       1613     1609       -4     
+ Partials      375      373       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bogdandrutu bogdandrutu added this pull request to the merge queue Jan 4, 2025
Merged via the queue into open-telemetry:main with commit 3e87d0d Jan 4, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants