-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
…sed batching (#12154) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR adds config API that will be used for serialized bytes based batching. We will deprecate `MinSizeConfig` and `MaxSizeConfig` in favor of: ``` type SizeConfig struct { Sizer string `mapstructure:"sizer"` MinSize int `mapstructure:"mix_size"` MaxSize int `mapstructure:"max_size"` } ``` <!-- Issue number if applicable --> #### Link to tracking issue #3262 #12303 <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Dmitrii Anoshin <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
component: exporterhelper | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Adds the config API to support serialized bytes based batching | ||
|
||
# One or more tracking issues or pull requests related to the change | ||
issues: [3262] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [api] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package exporterbatcher // import "go.opentelemetry.io/collector/exporter/exporterbatcher" | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type SizerType string | ||
|
||
const ( | ||
SizerTypeItems SizerType = "items" | ||
SizerTypeBytes SizerType = "bytes" | ||
) | ||
|
||
// UnmarshalText implements TextUnmarshaler interface. | ||
func (s *SizerType) UnmarshalText(text []byte) error { | ||
switch str := string(text); str { | ||
case string(SizerTypeItems): | ||
*s = SizerTypeItems | ||
case string(SizerTypeBytes): | ||
*s = SizerTypeBytes | ||
default: | ||
return fmt.Errorf("invalid sizer: %q", str) | ||
} | ||
return nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.