diff --git a/.chloggen/datadogconnector-add-stats-obfuscation.yaml b/.chloggen/datadogconnector-add-stats-obfuscation.yaml index 73d2997afd1d..66ab2473586c 100644 --- a/.chloggen/datadogconnector-add-stats-obfuscation.yaml +++ b/.chloggen/datadogconnector-add-stats-obfuscation.yaml @@ -10,7 +10,7 @@ component: datadogconnector note: Support obfuscating sql queries in APM stats # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. -issues: [35401] +issues: [37457] # (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/connector/datadogconnector/connector_native.go b/connector/datadogconnector/connector_native.go index e72b3c2095d2..5f2ff50863fc 100644 --- a/connector/datadogconnector/connector_native.go +++ b/connector/datadogconnector/connector_native.go @@ -116,8 +116,6 @@ func (c *traceToMetricConnectorNative) Shutdown(context.Context) error { c.logger.Info("Stopping obfuscator and concentrator") // stop the obfuscator and concentrator and wait for the run loop to exit c.obfuscator.Stop() - c.logger.Info("Stopping concentrator") - // stop the concentrator and wait for the run loop to exit c.concentrator.Stop() c.exit <- struct{}{} // signal exit <-c.exit // wait for close diff --git a/connector/datadogconnector/connector_native_test.go b/connector/datadogconnector/connector_native_test.go index 394838ed4fce..af6637ef8d7e 100644 --- a/connector/datadogconnector/connector_native_test.go +++ b/connector/datadogconnector/connector_native_test.go @@ -73,6 +73,8 @@ func creteConnectorNativeWithCfg(t *testing.T, cfg *Config) (*traceToMetricConne connector, ok := tconn.(*traceToMetricConnectorNative) require.True(t, ok) + oconf := obfuscate.Config{Redis: obfuscate.RedisConfig{Enabled: false}} + connector.obfuscator = obfuscate.NewObfuscator(oconf) return connector, metricsSink } @@ -273,12 +275,15 @@ func testMeasuredAndClientKindNative(t *testing.T, enableOperationAndResourceNam func TestObfuscate(t *testing.T) { cfg := NewFactory().CreateDefaultConfig().(*Config) cfg.Traces.BucketInterval = time.Second - connector, metricsSink := creteConnectorNativeWithCfg(t, cfg) - oconf := obfuscate.Config{Redis: obfuscate.RedisConfig{Enabled: true}} - connector.obfuscator = obfuscate.NewObfuscator(oconf) - connector.tcfg.Features["enable_receive_resource_spans_v2"] = struct{}{} - connector.tcfg.Features["enable_operation_and_resource_name_logic_v2"] = struct{}{} + if err := featuregate.GlobalRegistry().Set("datadog.EnableReceiveResourceSpansV2", true); err != nil { + t.Fatal(err) + } + if err := featuregate.GlobalRegistry().Set("datadog.EnableOperationAndResourceNameV2", true); err != nil { + t.Fatal(err) + } + + connector, metricsSink := creteConnectorNativeWithCfg(t, cfg) err := connector.Start(context.Background(), componenttest.NewNopHost()) require.NoError(t, err)