Skip to content
Draft
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
30 changes: 30 additions & 0 deletions .chloggen/signaltometrics-default-error-mode-ignore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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. receiver/filelog)
component: connector/signaltometrics

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add `connector.signaltometrics.defaultErrorModeIgnore` feature gate to change default `error_mode` to `ignore`

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [48419]

# (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: |
When the feature gate is enabled, the connector defaults to `ignore` mode which preserves
valid data when an OTTL condition or statement error occurs, improving resiliency. This is
a breaking change rolled out via feature gate to allow gradual adoption.

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: [user]
3 changes: 2 additions & 1 deletion connector/signaltometricsconnector/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ type Config struct {
// If an error occurs, the record is skipped and the error is logged.
// `silent` means the connector ignores errors returned by conditions and continues processing.
// If an error occurs, the record is skipped and the error is not logged.
// The default value is `propagate`.
// The default value is `propagate`, but when the `connector.signaltometrics.defaultErrorModeIgnore`
// feature gate is enabled, the default changes to `ignore`.
ErrorMode ottl.ErrorMode `mapstructure:"error_mode"`
// prevent unkeyed literal initialization
_ struct{}
Expand Down
9 changes: 8 additions & 1 deletion connector/signaltometricsconnector/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan"
)

func defaultErrorMode() ottl.ErrorMode {
if metadata.ConnectorSignaltometricsDefaultErrorModeIgnoreFeatureGate.IsEnabled() {
return ottl.IgnoreError
}
return ottl.PropagateError
}

// NewFactory returns a ConnectorFactory.
func NewFactory() connector.Factory {
return xconnector.NewFactory(
Expand All @@ -39,7 +46,7 @@ func NewFactory() connector.Factory {

func createDefaultConfig() component.Config {
return &config.Config{
ErrorMode: ottl.PropagateError,
ErrorMode: defaultErrorMode(),
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions connector/signaltometricsconnector/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ status:
codeowners:
active: [ChrsMark, lahsivjar]

feature_gates:
- id: connector.signaltometrics.defaultErrorModeIgnore
description: When enabled, the default error_mode is `ignore` instead of `propagate`.
stage: alpha
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/48419

tests:
config:
spans:
Expand Down
Loading