ActivitySource
Provides APIs to create and start Activity objects and to register ActivityListener objects to listen to the Activity events.
Returns the activity source name.
Returns the activity source version.
Constructs an activity source object with the specified name.
Adds a listener to the activity starting and stopping events.
Disposes the activity source object, removes the current instance from the global list, and empties the listeners list.
Checks if there are any listeners for this activity source.
Creates a new activity if there are active listeners for it, using the specified name and activity kind.
public Activity StartActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default)
Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent activity context, tags, optional activity link and optional start time.
public Activity StartActivity(string name, ActivityKind kind, string parentId, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default)
Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent Id, tags, optional activity links and optional start time.
public Activity StartActivity(ActivityKind kind, ActivityContext parentContext = default, IEnumerable<KeyValuePair<string, object>> tags = null, IEnumerable<ActivityLink> links = null, DateTimeOffset startTime = default, string name = "")