次の方法で共有


OpenTelemetryScope.GetActivityContext Method

Definition

Gets the ActivityContext for this scope's span.

public System.Diagnostics.ActivityContext? GetActivityContext();
member this.GetActivityContext : unit -> Nullable<System.Diagnostics.ActivityContext>
Public Function GetActivityContext () As Nullable(Of ActivityContext)

Returns

An ActivityContext for this scope's span, or null if no activity exists.

Remarks

The returned context can be passed as parentContext to child scope Start methods to establish a parent-child relationship within the same process.

Applies to