-
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 (85.04%) 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.50% 91.46% -0.05%
==========================================
Files 480 480
Lines 26464 26522 +58
==========================================
+ Hits 24217 24259 +42
- Misses 1778 1794 +16
Partials 469 469 ☔ 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
435e943
to
a642804
Compare
8b6b343
to
0ea6532
Compare
ca7fc03
to
c8e1657
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