Skip to content

Commit c9e3f0a

Browse files
committed
updated comment description
1 parent 6672ca7 commit c9e3f0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName,
4848
DiagnosticScope scope = LazyOperationScopeFactory.Value.CreateScope(name: operationName,
4949
kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client);
5050

51-
// The scope here checks for listeners at Operation Level.
51+
// Need a parent activity id associated with the operation which is logged in diagnostics and used for tracing purpose.
5252
// If there are listeners at operation level then scope is enabled and it tries to create activity.
53+
// However, if available listeners are not subscribed to operation level event then it will lead to scope being enabled but no activity is created.
5354
if (scope.IsEnabled)
5455
{
5556
scope.SetDisplayName($"{operationName} {containerName}");
@@ -64,9 +65,9 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName,
6465
config: requestOptions?.CosmosThresholdOptions ?? clientContext.ClientOptions?.CosmosClientTelemetryOptions.CosmosThresholdOptions);
6566
}
6667
#if !INTERNAL
67-
// The scope here checks for listeners at Network Level.
68+
// Need a parent activity which groups all network activities under it and is logged in diagnostics and used for tracing purpose.
6869
// If there are listeners at network level then scope is enabled and it tries to create activity.
69-
// Need a parent activity at root level so as to group all network activities under it.
70+
// However, if available listeners are not subscribed to network event then it will lead to scope being enabled but no activity is created.
7071
else
7172
{
7273
DiagnosticScope requestScope = LazyNetworkScopeFactory.Value.CreateScope(name: operationName);
@@ -75,6 +76,7 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName,
7576

7677
// If there are no listeners at operation level and network level and no parent activity created.
7778
// Then create a dummy activity as there should be a parent level activity always when Distributed tracing is on.
79+
// The parent activity id is logged in diagnostics and used for tracing purpose.
7880
if (Activity.Current is null)
7981
{
8082
openTelemetryRecorder = OpenTelemetryCoreRecorder.CreateParentActivity(operationName);

0 commit comments

Comments
 (0)