Skip to content

Commit b53b5ad

Browse files
authored
[connector/routing] Change default value of 'match_once' to true. (#36884)
1 parent 33c5306 commit b53b5ad

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: routingconnector
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Change default value of `match_once` parameter to `true`.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [29882]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: This field was deprecated in v0.116.0 and will be removed in v0.120.0.
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

connector/routingconnector/config_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestLoadConfig(t *testing.T) {
2727
configPath: filepath.Join("testdata", "config", "traces.yaml"),
2828
id: component.NewIDWithName(metadata.Type, ""),
2929
expected: &Config{
30+
MatchOnce: true,
3031
DefaultPipelines: []pipeline.ID{
3132
pipeline.NewIDWithName(pipeline.SignalTraces, "otlp-all"),
3233
},
@@ -52,6 +53,7 @@ func TestLoadConfig(t *testing.T) {
5253
configPath: filepath.Join("testdata", "config", "metrics.yaml"),
5354
id: component.NewIDWithName(metadata.Type, ""),
5455
expected: &Config{
56+
MatchOnce: true,
5557
DefaultPipelines: []pipeline.ID{
5658
pipeline.NewIDWithName(pipeline.SignalMetrics, "otlp-all"),
5759
},
@@ -77,6 +79,7 @@ func TestLoadConfig(t *testing.T) {
7779
configPath: filepath.Join("testdata", "config", "logs.yaml"),
7880
id: component.NewIDWithName(metadata.Type, ""),
7981
expected: &Config{
82+
MatchOnce: true,
8083
DefaultPipelines: []pipeline.ID{
8184
pipeline.NewIDWithName(pipeline.SignalLogs, "otlp-all"),
8285
},

connector/routingconnector/factory.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewFactory() connector.Factory {
3131
func createDefaultConfig() component.Config {
3232
return &Config{
3333
ErrorMode: ottl.PropagateError,
34+
MatchOnce: true,
3435
}
3536
}
3637

connector/routingconnector/logs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ func newLogsConnector(
3535
) (*logsConnector, error) {
3636
cfg := config.(*Config)
3737

38-
// TODO update log from warning to error in v0.116.0
3938
if !cfg.MatchOnce {
40-
set.Logger.Warn("The 'match_once' field has been deprecated. Set to 'true' to suppress this warning.")
39+
set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.")
4140
}
4241

4342
lr, ok := logs.(connector.LogsRouterAndConsumer)

connector/routingconnector/metrics.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ func newMetricsConnector(
3636
) (*metricsConnector, error) {
3737
cfg := config.(*Config)
3838

39-
// TODO update log from warning to error in v0.116.0
4039
if !cfg.MatchOnce {
41-
set.Logger.Warn("The 'match_once' field has been deprecated. Set to 'true' to suppress this warning.")
40+
set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.")
4241
}
4342

4443
mr, ok := metrics.(connector.MetricsRouterAndConsumer)

connector/routingconnector/traces.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ func newTracesConnector(
3535
) (*tracesConnector, error) {
3636
cfg := config.(*Config)
3737

38-
// TODO update log from warning to error in v0.116.0
3938
if !cfg.MatchOnce {
40-
set.Logger.Warn("The 'match_once' field has been deprecated. Set to 'true' to suppress this warning.")
39+
set.Logger.Error("The 'match_once' field has been deprecated and will be removed in v0.120.0. Remove usage of the parameter to suppress this warning.")
4140
}
4241

4342
tr, ok := traces.(connector.TracesRouterAndConsumer)

0 commit comments

Comments
 (0)