ContextModule

PackageAxial
Builds and scopes ambient telemetry attributes for Axial workflows.

Contents

Summary

NameSignatureSynopsis
Operations
attributeContext.attribute key valueCreates an application-defined attribute by pairing a typed key with a value.
emptyContext.empty An empty telemetry context.
ofAttributesContext.ofAttributes attributesCreates a context from attributes.
addContext.add item (TelemetryContext values)Adds or replaces one attribute.
addManyContext.addMany attributes contextAdds attributes.
tryFindContext.tryFind key (TelemetryContext values)Reads a typed attribute from a context.
toSeqContext.toSeq (TelemetryContext values)Returns the attributes in name order.
endUserIdContext.endUserId valueCreates the OpenTelemetry enduser.id span attribute.
addEndUserIdContext.addEndUserId value contextAdds the OpenTelemetry enduser.id span attribute to a context.
withContextContext.withContext context flowScopes a telemetry context around a workflow.
withAttributeContext.withAttribute item flowScopes one telemetry attribute around a workflow.
withAttributesContext.withAttributes attributes flowScopes telemetry attributes around a workflow.
withEndUserIdContext.withEndUserId value flowScopes the OpenTelemetry enduser.id span attribute around a workflow.
currentContext.current Reads the currently scoped telemetry context.
withSinkContext.withSink sink flowNo description available.
addSinkContext.addSink sink flowNo description available.

Operations

kind:member

attribute

Context.attribute key value
Member
Creates an application-defined attribute by pairing a typed key with a value.

Parameters

NameTypeDescription
keyAttributeKey<'value>
value'value

Returns

Attribute
kind:member

empty

Context.empty
Member
An empty telemetry context.

Returns

TelemetryContext
kind:member

ofAttributes

Context.ofAttributes attributes
Member
Creates a context from attributes. Later duplicate names replace earlier values.

Parameters

NameTypeDescription
attributesAttribute seq

Returns

TelemetryContext
kind:member

add

Context.add item (TelemetryContext values)
Member
Adds or replaces one attribute.

Parameters

NameTypeDescription
itemAttribute
TelemetryContext valuesTelemetryContext

Returns

TelemetryContext
kind:member

addMany

Context.addMany attributes context
Member
Adds attributes. Later duplicate names replace earlier values.

Parameters

NameTypeDescription
attributesAttribute seq
contextTelemetryContext

Returns

TelemetryContext
kind:member

tryFind

Context.tryFind key (TelemetryContext values)
Member
Reads a typed attribute from a context.

Parameters

NameTypeDescription
keyAttributeKey<'value>
TelemetryContext valuesTelemetryContext

Returns

'value option
kind:member

toSeq

Context.toSeq (TelemetryContext values)
Member
Returns the attributes in name order.

Parameters

NameTypeDescription
TelemetryContext valuesTelemetryContext

Returns

Attribute seq
kind:member

endUserId

Context.endUserId value
Member
Creates the OpenTelemetry enduser.id span attribute.

Parameters

NameTypeDescription
valuestring

Returns

Attribute
kind:member

addEndUserId

Context.addEndUserId value context
Member
Adds the OpenTelemetry enduser.id span attribute to a context.

Parameters

NameTypeDescription
valuestring
contextTelemetryContext

Returns

TelemetryContext
kind:member

withContext

Context.withContext context flow
Member
Scopes a telemetry context around a workflow.

Parameters

NameTypeDescription
contextTelemetryContext
flowFlow<'a, 'b, 'c>

Returns

Flow<'a, 'b, 'c>
kind:member

withAttribute

Context.withAttribute item flow
Member
Scopes one telemetry attribute around a workflow.

Parameters

NameTypeDescription
itemAttribute
flowFlow<'a, 'b, 'c>

Returns

Flow<'a, 'b, 'c>
kind:member

withAttributes

Context.withAttributes attributes flow
Member
Scopes telemetry attributes around a workflow.

Parameters

NameTypeDescription
attributesAttribute seq
flowFlow<'a, 'b, 'c>

Returns

Flow<'a, 'b, 'c>
kind:member

withEndUserId

Context.withEndUserId value flow
Member
Scopes the OpenTelemetry enduser.id span attribute around a workflow.

Parameters

NameTypeDescription
valuestring
flowFlow<'a, 'b, 'c>

Returns

Flow<'a, 'b, 'c>
kind:member

current

Context.current
Member
Reads the currently scoped telemetry context.

Returns

Flow<'env, 'error, TelemetryContext>
kind:member

withSink

Context.withSink sink flow
Member

Parameters

NameTypeDescription
sinkAttribute -> unit
flowFlow<'env, 'error, 'value>

Returns

Flow<'env, 'error, 'value>
kind:member

addSink

Context.addSink sink flow
Member

Parameters

NameTypeDescription
sinkAttribute -> unit
flowFlow<'env, 'error, 'value>

Returns

Flow<'env, 'error, 'value>