Edit

Share via


DiagnosticSource.StopActivity Method

Definition

Overloads

StopActivity(Activity, Object)

Stops the given Activity, maintains the global Current activity, and notifies consumers that the Activity was stopped.

StopActivity<T>(Activity, T)

Starts an Activity and writes a start event.

StopActivity(Activity, Object)

Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs

Stops the given Activity, maintains the global Current activity, and notifies consumers that the Activity was stopped.

public:
 void StopActivity(System::Diagnostics::Activity ^ activity, System::Object ^ args);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")]
public void StopActivity(System.Diagnostics.Activity activity, object? args);
public void StopActivity(System.Diagnostics.Activity activity, object? args);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("DiagnosticSource may require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
public void StopActivity(System.Diagnostics.Activity activity, object? args);
public void StopActivity(System.Diagnostics.Activity activity, object args);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")>]
member this.StopActivity : System.Diagnostics.Activity * obj -> unit
member this.StopActivity : System.Diagnostics.Activity * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("DiagnosticSource may require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")>]
member this.StopActivity : System.Diagnostics.Activity * obj -> unit
Public Sub StopActivity (activity As Activity, args As Object)

Parameters

activity
Activity

The activity to be stopped.

args
Object

An object that represents the value passed as a payload for the event.

Attributes

Remarks

Producers may pass additional details to the consumer in the payload.

Consumers can access Activity.Current to add context and/or augment telemetry.

See also

Applies to

StopActivity<T>(Activity, T)

Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs

Starts an Activity and writes a start event.

public:
generic <typename T>
 void StopActivity(System::Diagnostics::Activity ^ activity, T args);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Only the properties of the T type will be preserved. Properties of referenced types and properties of derived types may be trimmed.")]
public void StopActivity<T>(System.Diagnostics.Activity activity, T args);
public void StopActivity<T>(System.Diagnostics.Activity activity, T args);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Only the properties of the T type will be preserved. Properties of referenced types and properties of derived types may be trimmed.")>]
member this.StopActivity : System.Diagnostics.Activity * 'T -> unit
member this.StopActivity : System.Diagnostics.Activity * 'T -> unit
Public Sub StopActivity(Of T) (activity As Activity, args As T)

Type Parameters

T

The type of the value being passed as a payload for the event.

Parameters

activity
Activity

The Activity to be started.

args
T

An object that represent the value being passed as a payload for the event.

Attributes

Applies to