LanguageExt.Sys

LanguageExt.Sys Sys Diag

Contents

class Activity <M, RT> Source #

where M : Monad<M>
where RT : Has<M, ActivitySourceIO>, Local<M, ActivityEnv>

An Activity has an operation name, an ID, a start time and duration, tags, and baggage.

Activities should be created by calling the span functions, configured as necessary. Each span function takes an Eff or Aff operation to run (which is the activity). The runtime system will maintain the parent/ child relationships for the activities, and maintains the 'current' activity.

Parameters

type M

Monad trait

type RT

Runtime

Properties

property K<M, Activity?> currentActivity Source #

property K<M, Option<string>> traceState Source #

Read the trace-state string of the current activity

property K<M, Option<ActivityTraceId>> traceId Source #

Read the trace ID of the current activity

property K<M, HashMap<string, string?>> baggage Source #

Read the baggage of the current activity

property K<M, HashMap<string, string?>> tags Source #

Read the tags of the current activity

property K<M, HashMap<string, object?>> tagObjects Source #

Read the tags of the current activity

property K<M, Option<ActivityContext>> context Source #

Read the context of the current activity

None if there is no current activity

property K<M, Option<TimeSpan>> duration Source #

Read the duration of the current activity

None if there is no current activity

property K<M, Seq<ActivityEvent>> events Source #

Read the events of the current activity

property K<M, Option<string>> id Source #

Read the ID of the current activity

None if there is no current activity

property K<M, Option<ActivityKind>> kind Source #

Read the kind of the current activity

None if there is no current activity

property K<M, Seq<ActivityLink>> links Source #

Read the links of the current activity

property K<M, Option<Activity>> current Source #

Read the current activity

None if there is no current activity

property K<M, Option<string>> parentId Source #

Read the parent ID of the current activity

None if there is no current activity

property K<M, Option<ActivitySpanId>> parentSpanId Source #

Read the parent span ID of the current activity

None if there is no current activity

property K<M, Option<bool>> recorded Source #

Read the recorded flag of the current activity

None if there is no current activity

property K<M, Option<string>> displayName Source #

Read the display-name of the current activity

None if there is no current activity

property K<M, Option<string>> operationName Source #

Read the operation-name of the current activity

None if there is no current activity

property K<M, Option<string>> rootId Source #

Read the root ID of the current activity

None if there is no current activity

property K<M, Option<ActivitySpanId>> spanId Source #

Read the span ID of the current activity

None if there is no current activity

property K<M, Option<DateTime>> startTimeUTC Source #

Read the start-time of the current activity

None if there is no current activity

Methods

method K<M, Activity> startActivity ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, ActivityContext? parentContext = default) Source #

method K<M, A> span <A> (string name, K<M, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method K<M, A> span <A> ( string name, ActivityKind activityKind, K<M, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method K<M, A> span <A> ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, K<M, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param activityTags

The optional tags list to initialise the created activity object with.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method K<M, TA> span <TA> ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, K<M, TA> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param activityTags

The optional tags list to initialise the created activity object with.

param activityLinks

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method K<M, A> span <A> ( string name, ActivityKind activityKind, ActivityContext parentContext, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, K<M, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param parentContext

The parent ActivityContext object to initialize the created activity object with

param activityTags

The optional tags list to initialise the created activity object with.

param activityLinks

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method K<M, Unit> setTraceState (string traceStateString) Source #

Set the state trace string

Parameters

param traceStateString

Trace state string

returns

Unit effect

method K<M, Unit> addBaggage (string key, string? value) Source #

Add baggage to the current activity

Parameters

param key

Baggage key

param value

Baggage value

returns

Unit effect

method K<M, Unit> addTag (string name, string? value) Source #

Add tag to the current activity

Parameters

param name

Tag name

param value

Tag value

returns

Unit effect

method K<M, Unit> addTag (string name, object? value) Source #

Add tag to the current activity

Parameters

param name

Tag name

param value

Tag value

method K<M, Unit> addEvent (ActivityEvent @event) Source #

Add an event to the current activity

Parameters

param event

Event

class Activity <RT> Source #

where RT : Has<Eff<RT>, ActivitySourceIO>, Local<Eff<RT>, ActivityEnv>

An Activity has an operation name, an ID, a start time and duration, tags, and baggage.

Activities should be created by calling the span functions, configured as necessary. Each span function takes an Eff or Aff operation to run (which is the activity). The runtime system will maintain the parent/ child relationships for the activities, and maintains the 'current' activity.

Parameters

type RT

Runtime

Properties

property Eff<RT, Option<string>> traceState Source #

Read the trace-state string of the current activity

property Eff<RT, Option<ActivityTraceId>> traceId Source #

Read the trace ID of the current activity

property Eff<RT, HashMap<string, string?>> baggage Source #

Read the baggage of the current activity

property Eff<RT, HashMap<string, string?>> tags Source #

Read the tags of the current activity

property Eff<RT, HashMap<string, object?>> tagObjects Source #

Read the tags of the current activity

property Eff<RT, Option<ActivityContext>> context Source #

Read the context of the current activity

None if there is no current activity

property Eff<RT, Option<TimeSpan>> duration Source #

Read the duration of the current activity

None if there is no current activity

property Eff<RT, Seq<ActivityEvent>> events Source #

Read the events of the current activity

property Eff<RT, Option<string>> id Source #

Read the ID of the current activity

None if there is no current activity

property Eff<RT, Option<ActivityKind>> kind Source #

Read the kind of the current activity

None if there is no current activity

property Eff<RT, Seq<ActivityLink>> links Source #

Read the links of the current activity

property Eff<RT, Option<Activity>> current Source #

Read the current activity

None if there is no current activity

property Eff<RT, Option<string>> parentId Source #

Read the parent ID of the current activity

None if there is no current activity

property Eff<RT, Option<ActivitySpanId>> parentSpanId Source #

Read the parent span ID of the current activity

None if there is no current activity

property Eff<RT, Option<bool>> recorded Source #

Read the recorded flag of the current activity

None if there is no current activity

property Eff<RT, Option<string>> displayName Source #

Read the display-name of the current activity

None if there is no current activity

property Eff<RT, Option<string>> operationName Source #

Read the operation-name of the current activity

None if there is no current activity

property Eff<RT, Option<string>> rootId Source #

Read the root ID of the current activity

None if there is no current activity

property Eff<RT, Option<ActivitySpanId>> spanId Source #

Read the span ID of the current activity

None if there is no current activity

property Eff<RT, Option<DateTime>> startTimeUTC Source #

Read the start-time of the current activity

None if there is no current activity

Methods

method Eff<RT, Activity> startActivity ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, ActivityContext? parentContext = default) Source #

method Eff<RT, A> span <A> (string name, K<Eff<RT>, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method Eff<RT, A> span <A> ( string name, ActivityKind activityKind, K<Eff<RT>, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method Eff<RT, A> span <A> ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, K<Eff<RT>, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param activityTags

The optional tags list to initialise the created activity object with.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method Eff<RT, TA> span <TA> ( string name, ActivityKind activityKind, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, K<Eff<RT>, TA> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param activityTags

The optional tags list to initialise the created activity object with.

param activityLinks

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method Eff<RT, A> span <A> ( string name, ActivityKind activityKind, ActivityContext parentContext, HashMap<string, object> activityTags, Seq<ActivityLink> activityLinks, DateTimeOffset startTime, K<Eff<RT>, A> operation) Source #

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.

Parameters

param name

The operation name of the activity.

param activityKind

The activity kind.

param parentContext

The parent ActivityContext object to initialize the created activity object with

param activityTags

The optional tags list to initialise the created activity object with.

param activityLinks

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

param operation

The operation to whose activity will be traced

returns

The result of the operation

method Eff<RT, Unit> setTraceState (string traceStateString) Source #

Set the state trace string

Parameters

param traceStateString

Trace state string

returns

Unit effect

method Eff<RT, Unit> addBaggage (string key, string? value) Source #

Add baggage to the current activity

Parameters

param key

Baggage key

param value

Baggage value

returns

Unit effect

method Eff<RT, Unit> addTag (string name, string? value) Source #

Add tag to the current activity

Parameters

param name

Tag name

param value

Tag value

returns

Unit effect

method Eff<RT, Unit> addTag (string name, object? value) Source #

Add tag to the current activity

Parameters

param name

Tag name

param value

Tag value

method Eff<RT, Unit> addEvent (ActivityEvent @event) Source #

Add an event to the current activity

Parameters

param event

Event