-
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
Start using the new SizeConfig #12486
Conversation
c41d07d
to
9220c8a
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (85.10%) 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 #12486 +/- ##
==========================================
- Coverage 92.19% 92.16% -0.04%
==========================================
Files 465 465
Lines 25204 25208 +4
==========================================
- Hits 23238 23233 -5
- Misses 1570 1576 +6
- Partials 396 399 +3 ☔ View full report in Codecov by Sentry. |
d8907a4
to
b000208
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.
Otherwise, LGTM
Signed-off-by: Bogdan Drutu <[email protected]>
1b8a6e0
to
7891ea3
Compare
af5b873
if c.MinSizeItems != nil { | ||
c.SizeConfig.MinSize = *c.MinSizeItems | ||
} | ||
if c.MaxSizeItems != 0 && c.MaxSizeItems < c.MinSizeItems { | ||
return errors.New("max_size_items must be greater than or equal to min_size_items") | ||
|
||
if c.MaxSizeItems != nil { | ||
c.SizeConfig.MaxSize = *c.MaxSizeItems |
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.
The doc comments above say:
// Deprecated: [v0.121.0] Ignored if SizeConfig is set.
MinSizeConfig `mapstructure:",squash"`
// Deprecated: [v0.121.0] Ignored if SizeConfig is set.
MaxSizeConfig `mapstructure:",squash"
... whereas here we're overriding SizeConfig with Min/MaxSizeConfig if they're set. Behaviour/docs don't seem to line up.
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 is fixed in #12502
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.
👍 thanks!
#### Description Updated BatcherConfig to support the new SizeConfig, which replaces the now-deprecated MinSizeItems and MaxSizeItems. BatcherConfig now embeds the exporterbatcher.Config and sets an additional unexported field to track whether `batcher::enabled` has been set. See open-telemetry/opentelemetry-collector#12486 #### Link to tracking issue N/A #### Testing Added unit test #### Documentation Updated README.
This PR also temporary removes "bytes" as supported sizer type since it is not yet implemented.