-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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] configuration and config validation for bytes based batching #12154
base: main
Are you sure you want to change the base?
[exporter][batching] configuration and config validation for bytes based batching #12154
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12154 +/- ##
=======================================
Coverage 91.73% 91.73%
=======================================
Files 463 463
Lines 24819 24834 +15
=======================================
+ Hits 22767 22782 +15
Misses 1670 1670
Partials 382 382 ☔ View full report in Codecov by Sentry. |
MinSizeItems int `mapstructure:"min_size_items"` | ||
MinSizeBytes int `mapstructure:"min_size_bytes"` |
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.
What if we have a "Sizer"("SizerType") as enum with 3 values (request, items, bytes) and the "size" value instead?
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.
Good idea. How about something like this:
type BatcherConfig struct {
...
minSize SizeConfig `mapstructure:"min_size"`
maxSize SizeConfig `mapstructure:"max_size"`
}
type SizeConfig struct {
sizer string `mapstructure:"sizer"`
size int `mapstructure:"size"`
}
func (c SizeConfig) validate() {
...
}
Does the option request
mean that the request will implement its own sizing method?
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.
Not sure if we need "sizer" in both min/max, since I don't think we need to accept different sizer for min and max.
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 don't think we need to accept different sizer for min and max.
Good point. How about
type BatcherConfig struct {
...
sizer SizeType `mapstructure:",squash"`
minSize int `mapstructure:"max_size"`
maxSize int `mapstructure:"max_size"`
}
type SizerType struct {
sizer string `mapstructure:"sizer"`
}
func (c SizerType) validate() {
}
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.
Why is "Sizer" a configuration string? What does it name, and how does the user configure it?
Description
This PR adds config API that will be used for serialized bytes based batching.
Link to tracking issue
#3262
Testing
Documentation