ActivitySource.CreateActivity 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.
Overloads
CreateActivity(String, ActivityKind) |
Creates a new Activity object if there is any listener to the Activity, returns |
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 |
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 |
CreateActivity(String, ActivityKind)
- Source:
- ActivitySource.cs
- Source:
- ActivitySource.cs
- 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
- kind
- ActivityKind
The ActivityKind
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
- Source:
- ActivitySource.cs
- Source:
- ActivitySource.cs
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.
- kind
- ActivityKind
The ActivityKind
- 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
- 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.
- kind
- ActivityKind
The ActivityKind
- 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.