OtelModule

PackageAxial.Telemetry.JavaScript
OpenTelemetry JS tracing for Axial workflows compiled with Fable: the JavaScript counterpart of the .NET package's Activity.trace, emitting through a host-supplied @opentelemetry/api object.

Summary

NameSignatureSynopsis
installNamedOtel.installNamed api instrumentationScopeNameInstalls a tracer under the supplied instrumentation scope name.
installOtel.install apiInstalls a tracer under Axial's default instrumentation scope.
installWithOtel.installWith api tracerInstalls an explicit tracer, for a custom instrumentation scope name.
uninstallOtel.uninstall ()Removes the installed tracer; subsequent traced flows run untraced.
traceWithOtel.traceWith renderError name sourceFlowJavaScript-only: on .NET this returns the flow unchanged.
traceOtel.trace name sourceFlowWraps a flow in a new OpenTelemetry span covering the workflow's execution.

installNamed

Otel.installNamed api instrumentationScopeName
Member
Installs a tracer under the supplied instrumentation scope name. Use the application's scope name for spans that describe application behavior. Call once at the application edge, after the OpenTelemetry JS SDK and its context manager are registered. JavaScript targets only.

Parameters

NameTypeDescription
apiOpenTelemetryApiThe @opentelemetry/api module object.
instrumentationScopeNamestringThe application instrumentation scope name.

Returns

unit

install

Otel.install api
Member
Installs a tracer under Axial's default instrumentation scope. Prefer installNamed when traced flows represent application behavior.

Parameters

NameTypeDescription
apiOpenTelemetryApiThe @opentelemetry/api module object.

Returns

unit

installWith

Otel.installWith api tracer
Member
Installs an explicit tracer, for a custom instrumentation scope name. JavaScript targets only.

Parameters

NameTypeDescription
apiOpenTelemetryApiThe @opentelemetry/api module object.
tracerTracerThe tracer to emit spans through.

Returns

unit

uninstall

Otel.uninstall ()
Member
Removes the installed tracer; subsequent traced flows run untraced.

Parameters

NameTypeDescription
unit

Returns

unit

traceWith

Otel.traceWith renderError name sourceFlow
Member
JavaScript-only: on .NET this returns the flow unchanged. Use Activity.traceWith from Axial.Telemetry on .NET targets.

Parameters

NameTypeDescription
renderError'error -> string
namestring
sourceFlowFlow<'env, 'error, 'value>

Returns

Flow<'env, 'error, 'value>

trace

Otel.trace name sourceFlow
Member
Wraps a flow in a new OpenTelemetry span covering the workflow's execution. Typed errors are rendered with string; see traceWith for a custom renderer. JavaScript targets only.

Parameters

NameTypeDescription
namestringThe span name.
sourceFlowFlow<'env, 'error, 'value>The flow to trace.

Returns

Flow<'env, 'error, 'value>