Skip to content

Commit 502bcb9

Browse files
[connector/routing] promote defaultErrorModeIgnore feature gate to beta (#49682)
1 parent 4e7ed14 commit 502bcb9

9 files changed

Lines changed: 33 additions & 39 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
change_type: breaking
2+
3+
component: connector/routing
4+
5+
note: Promote the `connector.routing.defaultErrorModeIgnore` feature gate to beta. The default `error_mode` is now `ignore` instead of `propagate`.
6+
7+
issues: [48418]
8+
9+
subtext: To restore the previous default of `propagate`, run the collector with the feature gate disabled by passing `--feature-gates=-connector.routing.defaultErrorModeIgnore`.
10+
11+
change_logs: [user]

connector/routingconnector/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The following settings are available:
4242
- `copy`: Matched data is copied to the target pipeline(s) but remains available for evaluation by subsequent routes. This allows the same data to be routed to multiple pipelines.
4343
- `table.pipelines (required)`: the list of pipelines to use when the routing condition is met.
4444
- `default_pipelines (optional)`: contains the list of pipelines to use when a record does not meet any of specified conditions.
45-
- `error_mode (optional)`: determines how errors returned from OTTL statements are handled. Valid values are `propagate`, `ignore` and `silent`. If `ignore` or `silent` is used and a statement's condition has an error then the payload will be routed to the default pipelines. When `silent` is used the error is not logged. If not supplied, `propagate` is used.
45+
- `error_mode (optional)`: determines how errors returned from OTTL statements are handled. Valid values are `propagate`, `ignore` and `silent`. If `ignore` or `silent` is used and a statement's condition has an error then the payload will be routed to the default pipelines. When `silent` is used the error is not logged. If not supplied, `ignore` is used.
4646

4747
### Context Inference
4848

connector/routingconnector/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ type Config struct {
3838
// condition has an error then the payload will be routed to the default exporter. `propagate`
3939
// means the processor returns the error up the pipeline. This will result in the payload being
4040
// dropped from the collector.
41-
// The default value is `propagate`, but when the `connector.routing.defaultErrorModeIgnore`
42-
// feature gate is enabled, the default changes to `ignore`.
41+
// The default value is `ignore` when the `connector.routing.defaultErrorModeIgnore` feature gate is enabled (default), and `propagate` when disabled.
4342
ErrorMode ottl.ErrorMode `mapstructure:"error_mode"`
4443
// DefaultPipelines contains the list of pipelines to use when a more specific record can't be
4544
// found in the routing table.

connector/routingconnector/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ properties:
3131
items:
3232
$ref: go.opentelemetry.io/collector/pipeline.id
3333
error_mode:
34-
description: ErrorMode determines how the processor reacts to errors that occur while processing an OTTL condition. Valid values are `ignore` and `propagate`. `ignore` means the processor ignores errors returned by conditions and continues on to the next condition. This is the recommended mode. If `ignore` is used and a statement's condition has an error then the payload will be routed to the default exporter. `propagate` means the processor returns the error up the pipeline. This will result in the payload being dropped from the collector. The default value is `propagate`, but when the `connector.routing.defaultErrorModeIgnore` feature gate is enabled, the default changes to `ignore`.
34+
description: ErrorMode determines how the processor reacts to errors that occur while processing an OTTL condition. Valid values are `ignore` and `propagate`. `ignore` means the processor ignores errors returned by conditions and continues on to the next condition. This is the recommended mode. If `ignore` is used and a statement's condition has an error then the payload will be routed to the default exporter. `propagate` means the processor returns the error up the pipeline. This will result in the payload being dropped from the collector. The default value is `ignore` when the `connector.routing.defaultErrorModeIgnore` feature gate is enabled (default), and `propagate` when disabled.
3535
$ref: /pkg/ottl.error_mode
3636
table:
3737
description: Table contains the routing table for this processor. Required.

connector/routingconnector/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) {
3131
DefaultPipelines: []pipeline.ID{
3232
pipeline.NewIDWithName(pipeline.SignalTraces, "otlp-all"),
3333
},
34-
ErrorMode: ottl.PropagateError,
34+
ErrorMode: ottl.IgnoreError,
3535
Table: []RoutingTableItem{
3636
{
3737
Statement: `route() where attributes["X-Tenant"] == "acme"`,
@@ -56,7 +56,7 @@ func TestLoadConfig(t *testing.T) {
5656
DefaultPipelines: []pipeline.ID{
5757
pipeline.NewIDWithName(pipeline.SignalMetrics, "otlp-all"),
5858
},
59-
ErrorMode: ottl.PropagateError,
59+
ErrorMode: ottl.IgnoreError,
6060
Table: []RoutingTableItem{
6161
{
6262
Statement: `route() where attributes["X-Tenant"] == "acme"`,
@@ -81,7 +81,7 @@ func TestLoadConfig(t *testing.T) {
8181
DefaultPipelines: []pipeline.ID{
8282
pipeline.NewIDWithName(pipeline.SignalLogs, "otlp-all"),
8383
},
84-
ErrorMode: ottl.PropagateError,
84+
ErrorMode: ottl.IgnoreError,
8585
Table: []RoutingTableItem{
8686
{
8787
Statement: `route() where attributes["X-Tenant"] == "acme"`,

connector/routingconnector/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ This component has the following feature gates:
88

99
| Feature Gate | Stage | Description | From Version | To Version | Reference |
1010
| ------------ | ----- | ----------- | ------------ | ---------- | --------- |
11-
| `connector.routing.defaultErrorModeIgnore` | alpha | When enabled, the default error_mode is `ignore` instead of `propagate`. | v0.155.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/48418) |
11+
| `connector.routing.defaultErrorModeIgnore` | beta | When enabled, the default error_mode is `ignore` instead of `propagate`. | v0.155.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/48418) |
1212

1313
For more information about feature gates, see the [Feature Gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md) documentation.

connector/routingconnector/factory_test.go

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,34 +65,18 @@ func TestCreationFailsWithIncorrectConsumer(t *testing.T) {
6565
}
6666

6767
func TestDefaultErrorModeWithFeatureGate(t *testing.T) {
68-
tests := []struct {
69-
name string
70-
featureGateEnabled bool
71-
expectedErrorMode ottl.ErrorMode
72-
}{
73-
{
74-
name: "feature gate disabled",
75-
featureGateEnabled: false,
76-
expectedErrorMode: ottl.PropagateError,
77-
},
78-
{
79-
name: "feature gate enabled",
80-
featureGateEnabled: true,
81-
expectedErrorMode: ottl.IgnoreError,
82-
},
83-
}
68+
factory := NewFactory()
69+
cfg := factory.CreateDefaultConfig()
8470

85-
for _, tt := range tests {
86-
t.Run(tt.name, func(t *testing.T) {
87-
previousValue := metadata.ConnectorRoutingDefaultErrorModeIgnoreFeatureGate.IsEnabled()
88-
require.NoError(t, featuregate.GlobalRegistry().Set(metadata.ConnectorRoutingDefaultErrorModeIgnoreFeatureGate.ID(), tt.featureGateEnabled))
89-
defer func() {
90-
require.NoError(t, featuregate.GlobalRegistry().Set(metadata.ConnectorRoutingDefaultErrorModeIgnoreFeatureGate.ID(), previousValue))
91-
}()
92-
93-
factory := NewFactory()
94-
cfg := factory.CreateDefaultConfig().(*Config)
95-
assert.Equal(t, tt.expectedErrorMode, cfg.ErrorMode)
96-
})
97-
}
71+
assert.Equal(t, ottl.IgnoreError, cfg.(*Config).ErrorMode)
72+
73+
t.Cleanup(func() {
74+
_ = featuregate.GlobalRegistry().Set(metadata.ConnectorRoutingDefaultErrorModeIgnoreFeatureGate.ID(), true)
75+
})
76+
77+
err := featuregate.GlobalRegistry().Set(metadata.ConnectorRoutingDefaultErrorModeIgnoreFeatureGate.ID(), false)
78+
require.NoError(t, err)
79+
80+
cfg = factory.CreateDefaultConfig()
81+
assert.Equal(t, ottl.PropagateError, cfg.(*Config).ErrorMode)
9882
}

connector/routingconnector/internal/metadata/generated_feature_gates.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

connector/routingconnector/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ status:
1414
feature_gates:
1515
- id: connector.routing.defaultErrorModeIgnore
1616
description: When enabled, the default error_mode is `ignore` instead of `propagate`.
17-
stage: alpha
17+
stage: beta
1818
from_version: v0.155.0
1919
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/48418
2020

0 commit comments

Comments
 (0)