Table of Contents

Interface INeosActivity

Namespace
GroupeIsa.Neos.Shared.Tracing
Assembly
GroupeIsa.Neos.Shared.dll

Provides an interface for managing and interacting with an activity, including setting tags, managing trace information, and configuring parent relationships.

public interface INeosActivity : IDisposable
Inherited Members

Properties

DisplayName

Gets or sets the display name of the activity.

string DisplayName { get; set; }

Property Value

string

Id

Gets the unique identifier of the activity.

string? Id { get; }

Property Value

string

Tags

Gets the tags of this activity.

IDictionary<string, object?> Tags { get; }

Property Value

IDictionary<string, object>

TraceState

Gets or sets the trace state string for the activity.

string? TraceState { get; set; }

Property Value

string

Methods

SetParentId(string)

Sets the parent ID for the activity.

void SetParentId(string traceParent)

Parameters

traceParent string

The parent trace identifier.

SetStatus(ActivityStatusCode, string?)

Sets the status of the activity.

void SetStatus(ActivityStatusCode status, string? description = null)

Parameters

status ActivityStatusCode

The status.

description string

An optional description of the status.

SetTag(string, int?)

Sets a tag on the activity with an integer value.

bool SetTag(string key, int? value)

Parameters

key string

The tag key.

value int?

The tag value.

Returns

bool

True if the tag was set; otherwise, false.

SetTag(string, object?)

Sets a tag on the activity with a serialized object value.

bool SetTag(string key, object? value)

Parameters

key string

The tag key.

value object

The tag value to serialize.

Returns

bool

True if the tag was set; otherwise, false.

SetTag(string, string?)

Sets a tag on the activity with a string value.

bool SetTag(string key, string? value)

Parameters

key string

The tag key.

value string

The tag value.

Returns

bool

True if the tag was set; otherwise, false.

SetTags(IConfiguration)

Sets standard service tags on the activity from configuration.

bool SetTags(IConfiguration configuration)

Parameters

configuration IConfiguration

The configuration to read service tags from.

Returns

bool

True if tags were set; otherwise, false.

SetTags(IDictionary<string, object?>)

Sets multiple tags on the activity from a dictionary of object values.

bool SetTags(IDictionary<string, object?> tags)

Parameters

tags IDictionary<string, object>

The tags to set.

Returns

bool

True if tags were set; otherwise, false.

SetTags(IDictionary<string, string>)

Sets multiple tags on the activity from a dictionary of string values.

bool SetTags(IDictionary<string, string> tags)

Parameters

tags IDictionary<string, string>

The tags to set.

Returns

bool

True if tags were set; otherwise, false.

Stop()

Stops the activity, marking it as completed.

void Stop()

SuppressRecord()

Suppresses the record of the activity, preventing it from being recorded in the trace.

void SuppressRecord()

WithTag(string, object?)

Adds or updates a tag with the specified key and value for the activity, returning the activity instance with the tag applied.

INeosActivity WithTag(string key, object? value)

Parameters

key string

The key that identifies the tag to add or update. Cannot be null or empty.

value object

The value to associate with the specified tag key. May be null to indicate the absence of a value.

Returns

INeosActivity

The activity instance with the specified tag added or updated.

Remarks

Tags can be used to attach additional metadata to the activity for tracing or diagnostic purposes.