<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />

ActivityCreationOptions<T>

public struct ActivityCreationOptions<T>
Encapsulates all the information that is sent to the activity listener, to make decisions about the creation of the activity instance, as well as its state. The possible generic type parameters are ActivityContext or String.
public ActivityKind Kind { get; }

Gets the activity kind which the activity will be created with.

public IEnumerable<ActivityLink> Links { get; }

Gets the enumeration of activity links that the activity will be created with.

public string Name { get; }

Gets the name to use as OperationName of the activity that will get created.

public T Parent { get; }

Gets the parent context or parent Id that the activity will get created with.

Gets the collection that is used to add more tags during the sampling process. The added tags are also added to the created Activity if it is decided that it should be created by the ActivityListener callbacks.

public ActivitySource Source { get; }

Gets the activity source that creates the activity.

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

Gets the tags that the activity will be created with.

public ActivityTraceId TraceId { get; }

Gets the trace Id to use in the Activity object if it is decided that it should be created by ActivityListener callbacks.

public string TraceState { get; set; }

Gets or initializes the trace state to use when creating the Activity.