-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[exporter] moved mergeBatchFunc and mergeBatchSplitFunc to request #11459
Conversation
39122c8
to
6f5643a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11459 +/- ##
==========================================
- Coverage 91.47% 91.41% -0.07%
==========================================
Files 433 433
Lines 23616 23657 +41
==========================================
+ Hits 21603 21625 +22
- Misses 1645 1658 +13
- Partials 368 374 +6 ☔ View full report in Codecov by Sentry. |
exporter/internal/request.go
Outdated
Merge(context.Context, BatchRequest) (BatchRequest, error) | ||
MergeSplit(context.Context, exporterbatcher.MaxSizeConfig, BatchRequest) ([]BatchRequest, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
exporter/internal/request.go
Outdated
Merge(context.Context, BatchRequest) (BatchRequest, error) | ||
MergeSplit(context.Context, exporterbatcher.MaxSizeConfig, BatchRequest) ([]BatchRequest, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think (maybe next PR) we can make the second func just Split.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this some time ago. AFAIR there was a performance hit coming from the Merge->Split sequence of calls. But I'd be happy if we can make it work with no problems
func (req *tracesRequest) Merge(_ context.Context, _ exporterhelper.BatchRequest) (exporterhelper.BatchRequest, error) { | ||
return nil, nil | ||
} | ||
|
||
// MergeSplit splits and/or merges the profiles into multiple requests based on the MaxSizeConfig. | ||
func (req *tracesRequest) MergeSplit(_ context.Context, _ exporterbatcher.MaxSizeConfig, _ exporterhelper.BatchRequest) ( | ||
[]exporterhelper.BatchRequest, error) { | ||
return nil, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test where tracesRequest
needs the BatchRequest
implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is confusing. tracesRequest in this file is solely for testing that merging profilesBatchRequest and tracesRequest would fail. Let me rename it to dummyRequest.
} | ||
return bs.sendMergeBatch(ctx, req) | ||
return bs.sendMergeBatch(ctx, req.(internal.BatchRequest)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom Request not implementing batching function would panic here. Let's return an error instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok for the moment to panic I believe since we are experimental. We will make it required to implement this to setup batching soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-sili for the moment move the functions on Request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bogdandrutu Thanks!
Do you mean instead of having Request and BatchRequest, we would like to have Merge() and MergeSplitBatch() as a required function and then just have Request? For users who do not do batching they can leave Merge() and MergeSplit() as noop I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For users who do not do batching they can leave Merge() and MergeSplit() as noop I assume?
Correct.
075207b
to
52d6e24
Compare
Please rebase |
315fe8b
to
2a6163d
Compare
2a6163d
to
bd64227
Compare
…pen-telemetry#11459) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR changes `mergeBatchFunc` and `mergeBatchSplit` function as a member function of `batchRequest`. <!-- Issue number if applicable --> #### Link to tracking issue <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
Description
This PR changes
mergeBatchFunc
andmergeBatchSplit
function as a member function ofbatchRequest
.Link to tracking issue
Testing
Documentation