@@ -73,6 +73,8 @@ func creteConnectorNativeWithCfg(t *testing.T, cfg *Config) (*traceToMetricConne
73
73
74
74
connector , ok := tconn .(* traceToMetricConnectorNative )
75
75
require .True (t , ok )
76
+ oconf := obfuscate.Config {Redis : obfuscate.RedisConfig {Enabled : false }}
77
+ connector .obfuscator = obfuscate .NewObfuscator (oconf )
76
78
return connector , metricsSink
77
79
}
78
80
@@ -273,12 +275,15 @@ func testMeasuredAndClientKindNative(t *testing.T, enableOperationAndResourceNam
273
275
func TestObfuscate (t * testing.T ) {
274
276
cfg := NewFactory ().CreateDefaultConfig ().(* Config )
275
277
cfg .Traces .BucketInterval = time .Second
276
- connector , metricsSink := creteConnectorNativeWithCfg (t , cfg )
277
278
278
- oconf := obfuscate.Config {Redis : obfuscate.RedisConfig {Enabled : true }}
279
- connector .obfuscator = obfuscate .NewObfuscator (oconf )
280
- connector .tcfg .Features ["enable_receive_resource_spans_v2" ] = struct {}{}
281
- connector .tcfg .Features ["enable_operation_and_resource_name_logic_v2" ] = struct {}{}
279
+ if err := featuregate .GlobalRegistry ().Set ("datadog.EnableReceiveResourceSpansV2" , true ); err != nil {
280
+ t .Fatal (err )
281
+ }
282
+ if err := featuregate .GlobalRegistry ().Set ("datadog.EnableOperationAndResourceNameV2" , true ); err != nil {
283
+ t .Fatal (err )
284
+ }
285
+
286
+ connector , metricsSink := creteConnectorNativeWithCfg (t , cfg )
282
287
283
288
err := connector .Start (context .Background (), componenttest .NewNopHost ())
284
289
require .NoError (t , err )
0 commit comments