ContextModule

PackageAxial
Builds and scopes ambient telemetry attributes for Axial workflows.

Contents

Summary

NameSignatureSynopsis
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.

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

empty

Context.empty
Member
An empty telemetry context.

Returns

TelemetryContext

ofAttributes

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

Parameters

NameTypeDescription
attributesAttribute seq

Returns

TelemetryContext

add

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

Parameters

NameTypeDescription
itemAttribute
TelemetryContext valuesTelemetryContext

Returns

TelemetryContext

addMany

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

Parameters

NameTypeDescription
attributesAttribute seq
contextTelemetryContext

Returns

TelemetryContext

tryFind

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

Parameters

NameTypeDescription
keyAttributeKey<'value>
TelemetryContext valuesTelemetryContext

Returns

'value option

toSeq

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

Parameters

NameTypeDescription
TelemetryContext valuesTelemetryContext

Returns

Attribute seq

endUserId

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

Parameters

NameTypeDescription
valuestring

Returns

Attribute

addEndUserId

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

Parameters

NameTypeDescription
valuestring
contextTelemetryContext

Returns

TelemetryContext

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>

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>

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>

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>

current

Context.current
Member
Reads the currently scoped telemetry context.

Returns

Flow<'env, 'error, TelemetryContext>

withSink

Context.withSink sink flow
Member

Parameters

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

Returns

Flow<'env, 'error, 'value>

addSink

Context.addSink sink flow
Member

Parameters

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

Returns

Flow<'env, 'error, 'value>