<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.0-preview.3.22175.4" />

ActivityEvent

public struct ActivityEvent
Represents an event containing a name and a timestamp, as well as an optional list of tags.
public string Name { get; }

Gets the activity event name.

public IEnumerable<KeyValuePair<string, object>> Tags { get; }

Gets the collection of tags associated with the event.

public DateTimeOffset Timestamp { get; }

Gets the activity event timestamp.

public ActivityEvent(string name)

Initializes a new activity event instance using the specified name and the current time as the event timestamp.

public ActivityEvent(string name, DateTimeOffset timestamp = default, ActivityTagsCollection tags = null)

Initializes a new activity event instance using the specified name, timestamp and tags.