OpenTelemetryScope.GetActivityContext Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.