Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/codeboten_deprecate-batcher-config.yaml
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: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: otlpexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Mark BatcherConfig as deprecated

# One or more tracking issues or pull requests related to the change
issues: [12726]

# (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: []
17 changes: 17 additions & 0 deletions exporter/otlpexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)

Expand All @@ -26,7 +27,23 @@ type Config struct {

// Experimental: This configuration is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved
//
// Deprecated: [v0.123.0] batch configuration moving to queue configuration.

Choose a reason for hiding this comment

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

Let's log something if enabled. Potentially add a featuregate and error if this is used, so users can easily still use it?

BatcherConfig exporterhelper.BatcherConfig `mapstructure:"batcher"`
// remove at the same time as BatcherConfig
hasBatcher bool
}

func (c *Config) Unmarshal(conf *confmap.Conf) error {
if err := conf.Unmarshal(c); err != nil {
return err
}

if conf.IsSet("batcher") {
fmt.Println("in here for sure")
c.hasBatcher = true
}
return nil
}

func (c *Config) Validate() error {
Expand Down
4 changes: 4 additions & 0 deletions exporter/otlpexporter/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ type baseExporter struct {
func newExporter(cfg component.Config, set exporter.Settings) *baseExporter {
oCfg := cfg.(*Config)

if oCfg.hasBatcher {
set.TelemetrySettings.Logger.Warn("using deprecated field: batcher")
}

userAgent := fmt.Sprintf("%s/%s (%s/%s)",
set.BuildInfo.Description, set.BuildInfo.Version, runtime.GOOS, runtime.GOARCH)

Expand Down
Loading