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)

StopActivity(Activity, Object)

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, object? args);
public void StopActivity (System.Diagnostics.Activity activity, object args);

Parameters

activity
Activity

The activity to be stopped.

args
Object

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

Remarks

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

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

Applies to

.NET 9 og andre versioner
Produkt Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

StopActivity<T>(Activity, T)

Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
Source:
DiagnosticSourceActivity.cs
public void StopActivity<T> (System.Diagnostics.Activity activity, T args);

Type Parameters

T

Parameters

activity
Activity
args
T

Applies to

.NET 9 og andre versioner
Produkt Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)