Skip to content
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

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 25, 2025

This PR also temporary removes "bytes" as supported sizer type since it is not yet implemented.

@bogdandrutu bogdandrutu requested review from a team, mx-psi, dmathieu and dmitryax as code owners February 25, 2025 20:44
@bogdandrutu bogdandrutu force-pushed the finishsize branch 3 times, most recently from c41d07d to 9220c8a Compare February 25, 2025 20:56
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 85.10638% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.16%. Comparing base (5812712) to head (7891ea3).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
exporter/exporterbatcher/config.go 75.00% 2 Missing and 2 partials ⚠️
exporter/exporterhelper/internal/base_exporter.go 0.00% 2 Missing and 1 partial ⚠️

❌ 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.
📢 Have feedback on the report? Share it here.

@bogdandrutu bogdandrutu force-pushed the finishsize branch 3 times, most recently from d8907a4 to b000208 Compare February 25, 2025 22:13
Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM

@bogdandrutu bogdandrutu added Skip Changelog PRs that do not require a CHANGELOG.md entry Skip Contrib Tests and removed Skip Changelog PRs that do not require a CHANGELOG.md entry labels Feb 25, 2025
@bogdandrutu bogdandrutu added this pull request to the merge queue Feb 26, 2025
Merged via the queue into open-telemetry:main with commit af5b873 Feb 26, 2025
41 of 42 checks passed
@bogdandrutu bogdandrutu deleted the finishsize branch February 26, 2025 00:21
github-merge-queue bot pushed a commit that referenced this pull request Feb 26, 2025
…12502)

In the batcher config, ignore deprecated `min_size_items` and
`max_size_items` fields if new `min_size` and `max_size` are set.

A follow-up to
#12486.
Comment on lines +59 to +64
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
Copy link
Contributor

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.

Copy link
Member

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks!

axw added a commit to axw/opentelemetry-collector-contrib that referenced this pull request Feb 27, 2025
axw added a commit to axw/opentelemetry-collector-contrib that referenced this pull request Feb 27, 2025
axw added a commit to axw/opentelemetry-collector-contrib that referenced this pull request Feb 27, 2025
axw added a commit to axw/opentelemetry-collector-contrib that referenced this pull request Feb 27, 2025
dmitryax pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Feb 27, 2025
#### 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants