ActivitySource
Returns the ActivitySource name.
Returns the ActivitySource version.
Construct an ActivitySource object with the input name
Add a listener to the Activity starting and stopping events.
Creates a new Activity object if there is any listener to the Activity, returns null otherwise.
public Activity CreateActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, ActivityIdFormat idFormat = 0)
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 Activity CreateActivity(string name, ActivityKind kind, string parentId, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, ActivityIdFormat idFormat = 0)
Creates a new Activity object if there is any listener to the Activity, returns null otherwise.
Dispose the ActivitySource object and remove the current instance from the global list. empty the listeners list too.
Check if there is any listeners for this ActivitySource.
This property can be helpful to tell if there is no listener, then no need to create Activity object
and avoid creating the objects needed to create Activity (e.g. ActivityContext)
Example of that is http scenario which can avoid reading the context data from the wire.
Creates and starts a new Activity object if there is any listener to the Activity, returns null otherwise.
public Activity StartActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default)
Creates and starts a new Activity object if there is any listener to the Activity events, returns null otherwise.
public Activity StartActivity(string name, ActivityKind kind, string parentId, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default)
Creates and starts a new Activity object if there is any listener to the Activity events, returns null otherwise.
public Activity StartActivity(ActivityKind kind, ActivityContext parentContext = default, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default, string name = "")
Creates and starts a new Activity object if there is any listener to the Activity events, returns null otherwise.