@@ -48,6 +48,9 @@ public TelemetryTests(ITestOutputHelper output)
48
48
[ MemberData ( nameof ( Data ) ) ]
49
49
public async Task Telemetry_Agentless_IsSentOnAppClose ( bool ? enableDependencies )
50
50
{
51
+ // This is the default, we're just setting it to test the telemetry sent
52
+ SetEnvironmentVariable ( ConfigurationKeys . GitMetadataEnabled , "1" ) ;
53
+
51
54
using var agent = MockTracerAgent . Create ( Output , useTelemetry : true ) ;
52
55
Output . WriteLine ( $ "Assigned port { agent . Port } for the agentPort.") ;
53
56
@@ -71,6 +74,19 @@ public async Task Telemetry_Agentless_IsSentOnAppClose(bool? enableDependencies)
71
74
await telemetry . AssertConfigurationAsync ( ConfigurationKeys . PropagationStyleExtract , "Datadog,tracecontext,baggage" ) ;
72
75
await telemetry . AssertConfigurationAsync ( ConfigurationKeys . PropagationStyleInject , "Datadog,tracecontext,baggage" ) ;
73
76
77
+ // verify that we report both the default and explicit value to telemetry
78
+ var allConfigKeys = ( await telemetry . GetConfigurationValuesAsync ( ConfigurationKeys . GitMetadataEnabled ) ) . ToList ( ) ;
79
+ allConfigKeys
80
+ . Should ( )
81
+ . HaveCount ( 2 )
82
+ . And
83
+ . BeEquivalentTo (
84
+ [
85
+ new { Name = ConfigurationKeys . GitMetadataEnabled , Value = true , Origin = "default" } ,
86
+ new { Name = ConfigurationKeys . GitMetadataEnabled , Value = true , Origin = "env_var" }
87
+ ] ) ;
88
+ allConfigKeys [ 0 ] . SeqId . Should ( ) . BeLessThan ( allConfigKeys [ 1 ] . SeqId ) ;
89
+
74
90
await AssertServiceAsync ( telemetry , "Samples.Telemetry" , ServiceVersion ) ;
75
91
await AssertDependenciesAsync ( telemetry , enableDependencies ) ;
76
92
await AssertNoRedactedErrorLogsAsync ( telemetry ) ;
0 commit comments