ActivitySource.CreateActivity Method

Definition

Overloads

CreateActivity(String, ActivityKind)

Creates a new Activity object if there is any listener to the Activity, returns null otherwise.

CreateActivity(String, ActivityKind, ActivityContext, IEnumerable<KeyValuePair<String,Object>>, IEnumerable<ActivityLink>, ActivityIdFormat)

Creates a new Activity object if there is any listener to the Activity, returns null otherwise. If the Activity object is created, it will not automatically start. Callers will need to call Start() to start it.

CreateActivity(String, ActivityKind, String, IEnumerable<KeyValuePair<String,Object>>, IEnumerable<ActivityLink>, ActivityIdFormat)

Creates a new Activity object if there is any listener to the Activity, returns null otherwise.

CreateActivity(String, ActivityKind)

Source:
ActivitySource.cs
Source:
ActivitySource.cs
Source:
ActivitySource.cs

Creates a new Activity object if there is any listener to the Activity, returns null otherwise.

public:
 System::Diagnostics::Activity ^ CreateActivity(System::String ^ name, System::Diagnostics::ActivityKind kind);
public System.Diagnostics.Activity? CreateActivity (string name, System.Diagnostics.ActivityKind kind);
member this.CreateActivity : string * System.Diagnostics.ActivityKind -> System.Diagnostics.Activity
Public Function CreateActivity (name As String, kind As ActivityKind) As Activity

Parameters

name
String

The operation name of the Activity

Returns

The created Activity object or null if there are no listeners.

Remarks

If the Activity object is created, it will not start automatically. Callers need to call Start() to start it.

Applies to

CreateActivity(String, ActivityKind, ActivityContext, IEnumerable<KeyValuePair<String,Object>>, IEnumerable<ActivityLink>, ActivityIdFormat)

Source:
ActivitySource.cs
Source:
ActivitySource.cs
Source:
ActivitySource.cs

Creates a new Activity object if there is any listener to the Activity, returns null otherwise. If the Activity object is created, it will not automatically start. Callers will need to call Start() to start it.

public System.Diagnostics.Activity? CreateActivity (string name, System.Diagnostics.ActivityKind kind, System.Diagnostics.ActivityContext parentContext, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags = default, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = default, System.Diagnostics.ActivityIdFormat idFormat = System.Diagnostics.ActivityIdFormat.Unknown);
member this.CreateActivity : string * System.Diagnostics.ActivityKind * System.Diagnostics.ActivityContext * seq<System.Collections.Generic.KeyValuePair<string, obj>> * seq<System.Diagnostics.ActivityLink> * System.Diagnostics.ActivityIdFormat -> System.Diagnostics.Activity
Public Function CreateActivity (name As String, kind As ActivityKind, parentContext As ActivityContext, Optional tags As IEnumerable(Of KeyValuePair(Of String, Object)) = Nothing, Optional links As IEnumerable(Of ActivityLink) = Nothing, Optional idFormat As ActivityIdFormat = System.Diagnostics.ActivityIdFormat.Unknown) As Activity

Parameters

name
String

The operation name of the Activity.

parentContext
ActivityContext

The parent ActivityContext object to initialize the created Activity object with.

tags
IEnumerable<KeyValuePair<String,Object>>

The optional tags list to initialize the created Activity object with.

links
IEnumerable<ActivityLink>

The optional ActivityLink list to initialize the created Activity object with.

idFormat
ActivityIdFormat

The default Id format to use.

Returns

The created Activity object or null if there are no listeners.

Remarks

If the Activity object is created, it will not start automatically. Callers need to call Start() to start it.

Applies to

CreateActivity(String, ActivityKind, String, IEnumerable<KeyValuePair<String,Object>>, IEnumerable<ActivityLink>, ActivityIdFormat)

Source:
ActivitySource.cs
Source:
ActivitySource.cs
Source:
ActivitySource.cs

Creates a new Activity object if there is any listener to the Activity, returns null otherwise.

public System.Diagnostics.Activity? CreateActivity (string name, System.Diagnostics.ActivityKind kind, string parentId, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags = default, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = default, System.Diagnostics.ActivityIdFormat idFormat = System.Diagnostics.ActivityIdFormat.Unknown);
public System.Diagnostics.Activity? CreateActivity (string name, System.Diagnostics.ActivityKind kind, string? parentId, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags = default, System.Collections.Generic.IEnumerable<System.Diagnostics.ActivityLink>? links = default, System.Diagnostics.ActivityIdFormat idFormat = System.Diagnostics.ActivityIdFormat.Unknown);
member this.CreateActivity : string * System.Diagnostics.ActivityKind * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> * seq<System.Diagnostics.ActivityLink> * System.Diagnostics.ActivityIdFormat -> System.Diagnostics.Activity
Public Function CreateActivity (name As String, kind As ActivityKind, parentId As String, Optional tags As IEnumerable(Of KeyValuePair(Of String, Object)) = Nothing, Optional links As IEnumerable(Of ActivityLink) = Nothing, Optional idFormat As ActivityIdFormat = System.Diagnostics.ActivityIdFormat.Unknown) As Activity

Parameters

name
String

The operation name of the Activity.

parentId
String

The parent Id to initialize the created Activity object with.

tags
IEnumerable<KeyValuePair<String,Object>>

The optional tags list to initialize the created Activity object with.

links
IEnumerable<ActivityLink>

The optional ActivityLink list to initialize the created Activity object with.

idFormat
ActivityIdFormat

The default Id format to use.

Returns

The created Activity object or null if there are no listeners.

Remarks

If the Activity object is created, it will not start automatically. Callers need to call Start() to start it.

Applies to