Skip to content

Commit edeb94f

Browse files
committed
fix few more stuff
1 parent b410ea8 commit edeb94f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
namespace 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>

Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)