File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 44
55namespace Microsoft . Azure . Cosmos . Telemetry
66{
7- using System ;
87 using System . Net ;
9- using global ::Azure . Core ;
108 using Microsoft . Azure . Cosmos . Query . Core ;
119
1210 internal class OpenTelemetryAttributes
@@ -32,7 +30,6 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage)
3230 {
3331 this . OperationType = Documents . OperationType . Invalid ;
3432 }
35-
3633 }
3734
3835 /// <summary>
Original file line number Diff line number Diff line change @@ -242,13 +242,19 @@ public void Dispose()
242242 {
243243 OperationType operationType
244244 = ( this . response == null || this . response ? . OperationType == OperationType . Invalid ) ? this . operationType : this . response . OperationType ;
245+ if ( otelStabilityMode != OpenTelemetryStablityModes . DatabaseDupe )
246+ {
247+ string operationName = Enum . GetName ( typeof ( OperationType ) , operationType ) ;
248+ this . scope . AddAttribute ( AppInsightClassicAttributeKeys . OperationType , operationName ) ;
249+ }
250+
245251 if ( this . response != null )
246252 {
247253 if ( this . response . BatchSize is not null )
248254 {
249255 this . scope . AddIntegerAttribute ( OpenTelemetryAttributeKeys . BatchSize , ( int ) this . response . BatchSize ) ;
250256 }
251-
257+
252258 if ( otelStabilityMode == OpenTelemetryStablityModes . DatabaseDupe )
253259 {
254260 this . scope . AddIntegerAttribute ( OpenTelemetryAttributeKeys . StatusCode , ( int ) this . response . StatusCode ) ;
You can’t perform that action at this time.
0 commit comments