From d9230d3dfd211921f199d23a5dd2b8118d420ebe Mon Sep 17 00:00:00 2001 From: Yang Song Date: Wed, 23 Oct 2024 16:23:13 -0400 Subject: [PATCH 1/3] [connector, exporter/datadog] Enable compute_stats_by_span_kind and peer_tags_aggregation by default --- .chloggen/dd-conn-peer-tags.yaml | 27 +++++++++++++++++++ .chloggen/dd-exp-peer-tags.yaml | 27 +++++++++++++++++++ connector/datadogconnector/factory.go | 5 +++- connector/datadogconnector/factory_test.go | 5 +++- .../integration_test_config.yaml | 2 -- pkg/datadog/config/config.go | 5 +++- pkg/datadog/config/config_test.go | 18 ++++++++++--- pkg/datadog/config/config_warnings_test.go | 2 +- 8 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 .chloggen/dd-conn-peer-tags.yaml create mode 100644 .chloggen/dd-exp-peer-tags.yaml diff --git a/.chloggen/dd-conn-peer-tags.yaml b/.chloggen/dd-conn-peer-tags.yaml new file mode 100644 index 000000000000..7956e39db686 --- /dev/null +++ b/.chloggen/dd-conn-peer-tags.yaml @@ -0,0 +1,27 @@ +# 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. filelogreceiver) +component: datadogconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Flip configs `traces::compute_stats_by_span_kind`, `traces::peer_tags_aggregation` and `traces::peer_service_aggregation` to true by default" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [] + +# (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: "This enables Datadog APM stats on peer tags by default and is a backwards-compatible change. Read more on https://docs.datadoghq.com/tracing/guide/inferred-service-opt-in/." + +# 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: [] diff --git a/.chloggen/dd-exp-peer-tags.yaml b/.chloggen/dd-exp-peer-tags.yaml new file mode 100644 index 000000000000..5df058b07987 --- /dev/null +++ b/.chloggen/dd-exp-peer-tags.yaml @@ -0,0 +1,27 @@ +# 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. filelogreceiver) +component: datadogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Flip configs `traces::compute_stats_by_span_kind`, `traces::peer_tags_aggregation` and `traces::peer_service_aggregation` to true by default" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [] + +# (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: "This enables Datadog APM stats on peer tags by default and is a backwards-compatible change. Read more on https://docs.datadoghq.com/tracing/guide/inferred-service-opt-in/." + +# 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: [] diff --git a/connector/datadogconnector/factory.go b/connector/datadogconnector/factory.go index f5f4b95a7ff2..8cd5781f8d00 100644 --- a/connector/datadogconnector/factory.go +++ b/connector/datadogconnector/factory.go @@ -45,7 +45,10 @@ func createDefaultConfig() component.Config { return &Config{ Traces: TracesConfig{ TracesConfig: datadogconfig.TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, TraceBuffer: 1000, diff --git a/connector/datadogconnector/factory_test.go b/connector/datadogconnector/factory_test.go index f92056baa295..bce1dadd9040 100644 --- a/connector/datadogconnector/factory_test.go +++ b/connector/datadogconnector/factory_test.go @@ -21,7 +21,10 @@ func TestCreateDefaultConfig(t *testing.T) { &Config{ Traces: TracesConfig{ TracesConfig: datadogconfig.TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, TraceBuffer: 1000, BucketInterval: 10 * time.Second, diff --git a/exporter/datadogexporter/integrationtest/integration_test_config.yaml b/exporter/datadogexporter/integrationtest/integration_test_config.yaml index 19aa31595cf8..644faea073b3 100644 --- a/exporter/datadogexporter/integrationtest/integration_test_config.yaml +++ b/exporter/datadogexporter/integrationtest/integration_test_config.yaml @@ -21,8 +21,6 @@ processors: connectors: datadog/connector: traces: - compute_stats_by_span_kind: true - peer_tags_aggregation: true peer_tags: ["extra_peer_tag"] exporters: diff --git a/pkg/datadog/config/config.go b/pkg/datadog/config/config.go index 60542c785993..b30b13cd9cf4 100644 --- a/pkg/datadog/config/config.go +++ b/pkg/datadog/config/config.go @@ -324,7 +324,10 @@ func CreateDefaultConfig() component.Config { Endpoint: "https://trace.agent.datadoghq.com", }, TracesConfig: TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, }, diff --git a/pkg/datadog/config/config_test.go b/pkg/datadog/config/config_test.go index d19d51826922..ef1e0bd4599a 100644 --- a/pkg/datadog/config/config_test.go +++ b/pkg/datadog/config/config_test.go @@ -411,7 +411,10 @@ func TestCreateDefaultConfig(t *testing.T) { Endpoint: "https://trace.agent.datadoghq.com", }, TracesConfig: TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, }, Logs: LogsConfig{ @@ -480,7 +483,10 @@ func TestLoadConfig(t *testing.T) { Endpoint: "https://trace.agent.datadoghq.com", }, TracesConfig: TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, }, Logs: LogsConfig{ @@ -540,6 +546,9 @@ func TestLoadConfig(t *testing.T) { }, SpanNameAsResourceName: true, IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, TraceBuffer: 10, }, @@ -598,7 +607,10 @@ func TestLoadConfig(t *testing.T) { "old_name3": "new_name3", "old_name4": "new_name4", }, - IgnoreResources: []string{}, + IgnoreResources: []string{}, + PeerServiceAggregation: true, + PeerTagsAggregation: true, + ComputeStatsBySpanKind: true, }, }, Logs: LogsConfig{ diff --git a/pkg/datadog/config/config_warnings_test.go b/pkg/datadog/config/config_warnings_test.go index 976ccdd5f45d..402f7850a014 100644 --- a/pkg/datadog/config/config_warnings_test.go +++ b/pkg/datadog/config/config_warnings_test.go @@ -137,7 +137,7 @@ func TestPeerTags(t *testing.T) { { name: "traces::peer_service_aggregation and traces::peer_tags_aggregation unset", cfgMap: confmap.New(), - expectedPeerTagsValue: false, + expectedPeerTagsValue: true, }, { name: "traces::peer_tags_aggregation set", From 99c6eee15821ebc71a252d2f0abe7de7664dad3c Mon Sep 17 00:00:00 2001 From: Yang Song Date: Wed, 23 Oct 2024 17:08:24 -0400 Subject: [PATCH 2/3] Apply suggestions from code review --- .chloggen/dd-conn-peer-tags.yaml | 2 +- .chloggen/dd-exp-peer-tags.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.chloggen/dd-conn-peer-tags.yaml b/.chloggen/dd-conn-peer-tags.yaml index 7956e39db686..2df3ee8da4a1 100644 --- a/.chloggen/dd-conn-peer-tags.yaml +++ b/.chloggen/dd-conn-peer-tags.yaml @@ -10,7 +10,7 @@ component: datadogconnector note: "Flip configs `traces::compute_stats_by_span_kind`, `traces::peer_tags_aggregation` and `traces::peer_service_aggregation` to true by default" # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. -issues: [] +issues: [35969] # (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. diff --git a/.chloggen/dd-exp-peer-tags.yaml b/.chloggen/dd-exp-peer-tags.yaml index 5df058b07987..55fe8d5b5999 100644 --- a/.chloggen/dd-exp-peer-tags.yaml +++ b/.chloggen/dd-exp-peer-tags.yaml @@ -10,7 +10,7 @@ component: datadogexporter note: "Flip configs `traces::compute_stats_by_span_kind`, `traces::peer_tags_aggregation` and `traces::peer_service_aggregation` to true by default" # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. -issues: [] +issues: [35969] # (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. From 6154bd8aefe150bf08f08fd6810c562f9c12a743 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Mon, 9 Dec 2024 13:43:30 -0500 Subject: [PATCH 3/3] Fix test --- pkg/datadog/config/config_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/datadog/config/config_test.go b/pkg/datadog/config/config_test.go index b6bd3ca322cb..a5db98302203 100644 --- a/pkg/datadog/config/config_test.go +++ b/pkg/datadog/config/config_test.go @@ -696,7 +696,10 @@ func TestLoadConfig(t *testing.T) { Endpoint: "https://trace.agent.datadoghq.com", }, TracesConfig: TracesConfig{ - IgnoreResources: []string{}, + IgnoreResources: []string{}, + ComputeStatsBySpanKind: true, + PeerServiceAggregation: true, + PeerTagsAggregation: true, }, }, Logs: LogsConfig{