-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[exporterbatcher] Update batcher to support serialized bytes based batching. #12641
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (83.65%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12641 +/- ##
==========================================
- Coverage 91.66% 91.62% -0.05%
==========================================
Files 479 479
Lines 26355 26412 +57
==========================================
+ Hits 24159 24199 +40
- Misses 1733 1750 +17
Partials 463 463 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -31,6 +33,10 @@ type Request interface { | |||
MergeSplit(context.Context, exporterbatcher.SizeConfig, Request) ([]Request, error) | |||
} | |||
|
|||
type Sizer interface { |
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.
Where is this used?
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.
Removed.
exporter/exporterhelper/logs.go
Outdated
@@ -27,14 +28,14 @@ var ( | |||
type logsRequest struct { | |||
ld plog.Logs | |||
pusher consumer.ConsumeLogsFunc | |||
cachedSize int | |||
cachedSize map[exporterbatcher.SizerType]int |
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.
Better to have 2 values than this map which needs heap allocation and lookup is more expensive.
exporter/exporterhelper/logs.go
Outdated
case exporterbatcher.SizerTypeBytes: | ||
sz = &sizer.LogsBytesSizer{} | ||
default: | ||
return -1 |
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.
this design seems a bit off to return -1 here. At least document this behavior.
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 changed -1 to 0 and documented the behavior. Alternative is to panic if the sizer is unknown but I am reluctant to have any panic in the code
6526aa3
to
435e943
Compare
Description
This PR
cachedSize
is associated with thesizerType
.This will be followed by https://github.com/open-telemetry/opentelemetry-collector/pull/12635/files which enables turning on this feature from configuration.
Link to tracking issue
#3262
Testing
Documentation