-
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
[exporter][batching] Serialized bytes based batching for logs #12299
base: main
Are you sure you want to change the base?
[exporter][batching] Serialized bytes based batching for logs #12299
Conversation
51d907b
to
4f8b1fb
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (91.95%) 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 #12299 +/- ##
==========================================
- Coverage 92.19% 92.17% -0.03%
==========================================
Files 466 467 +1
Lines 25325 25371 +46
==========================================
+ Hits 23348 23385 +37
- Misses 1577 1585 +8
- Partials 400 401 +1 ☔ View full report in Codecov by Sentry. |
a3b9539
to
9e7b49f
Compare
a4221b4
to
669998a
Compare
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 still makes me slightly uncomfortable that split will accept a cfg with both MaxSizeItems and MaxSizeBytes set and simply ignore the second. I'd rather this function enforce the expectations that only one is set. But given the context, the change overall seems fine to me.
57457c8
to
d3fcbf5
Compare
d3fcbf5
to
01f2a11
Compare
01f2a11
to
4752210
Compare
1c718a4
to
826ab1a
Compare
826ab1a
to
6c1f0ad
Compare
1bf0777
to
697ed11
Compare
plog.ProtoMarshaler | ||
} | ||
|
||
// DeltaCapacity() returns the delta size of a proto slice when a new item is added. |
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.
// DeltaCapacity() returns the delta size of a proto slice when a new item is added. | |
// DeltaSize() returns the delta size of a proto slice when a new item is added. |
// | ||
// currSize := (prevSize + deltaCapacity(proto2.Size())) | ||
// | ||
// This is derived from gogo/protobuf 's Size() function |
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.
Can you please add a link to the Size()
function here
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.
Yes, and you might add that the constant 1
below is specialized for OTLP; it relies on protobuf tags < 16 (which are expressed w/ a single byte of overhead).
// | ||
// Then currSize of proto1 can be calculated as | ||
// | ||
// currSize := (prevSize + deltaCapacity(proto2.Size())) |
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.
// currSize := (prevSize + deltaCapacity(proto2.Size())) | |
// currSize := (prevSize + sizer.DeltaSize(proto2.Size())) |
ScopeLogsSize(sl plog.ScopeLogs) int | ||
LogRecordSize(lr plog.LogRecord) int | ||
|
||
// DeltaCapacity() returns the delta size when a ResourceLog, ScopeLog or LogRecord is added. |
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.
// DeltaSize() returns the delta size when a ResourceLog, ScopeLog or LogRecord is added.
// | ||
// currSize := (prevSize + deltaCapacity(proto2.Size())) | ||
// | ||
// This is derived from gogo/protobuf 's Size() function |
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.
Yes, and you might add that the constant 1
below is specialized for OTLP; it relies on protobuf tags < 16 (which are expressed w/ a single byte of overhead).
Description
This PR implements serialized bytes based batching. Right now, the feature is exposed to test only via an additional field in MaxSizeConfig, but we plan to evolve the config API soon (see discussion in #12154)
Link to tracking issue
#3262
Testing
Caveat
We book keep both item count and byte size regardless of batching option, which adds an overhead in both cases.