Emits OpenTelemetry spans for durable workflow execution. All methods
are no-ops when no OTel SDK is registered — @opentelemetry/api
returns a no-op tracer by default, so there is zero overhead without
a configured exporter.
Span Categories
Span
When
Mode
WORKFLOW/START/{name}
First execution (not replay)
info
WORKFLOW/COMPLETE/{name}
Workflow returns successfully
info
WORKFLOW/ERROR/{name}
Workflow throws a fatal error
info
ACTIVITY/{name}
Real wall-clock activity execution on the worker
info
DISPATCH/{type}/{name}/{idx}
Operation dispatched (first execution only)
debug
RETURN/{type}/{name}/{idx}
Operation result returned (with ac/au duration)
debug
Gating
isEnabled() — true when HMSH_TELEMETRY is set (any value)
isVerbose() — true only when HMSH_TELEMETRY === 'debug'
In info mode, engine-layer spans (stream hops, DAG activity spans)
are suppressed for durable workflows — only the spans above are
emitted. This keeps dashboards clean and focused on the user's
workflow story. Set HMSH_TELEMETRY=debug to also see engine
internals and per-operation DISPATCH/RETURN spans.
Setup
Register an OTel SDK with a trace exporter before starting workers:
Emits OpenTelemetry spans for durable workflow execution. All methods are no-ops when no OTel SDK is registered —
@opentelemetry/apireturns a no-op tracer by default, so there is zero overhead without a configured exporter.Span Categories
WORKFLOW/START/{name}infoWORKFLOW/COMPLETE/{name}infoWORKFLOW/ERROR/{name}infoACTIVITY/{name}infoDISPATCH/{type}/{name}/{idx}debugRETURN/{type}/{name}/{idx}debugGating
isEnabled()— true whenHMSH_TELEMETRYis set (any value)isVerbose()— true only whenHMSH_TELEMETRY === 'debug'In
infomode, engine-layer spans (stream hops, DAG activity spans) are suppressed for durable workflows — only the spans above are emitted. This keeps dashboards clean and focused on the user's workflow story. SetHMSH_TELEMETRY=debugto also see engine internals and per-operation DISPATCH/RETURN spans.Setup
Register an OTel SDK with a trace exporter before starting workers: