TC39 class decorator that instruments a Cloudflare Workflow with OpenTelemetry tracing.
Intercepts the run method to:
run
traceparent
event.payload
workflow.run
step
do
sleep
sleepUntil
SDK configuration. env falls back to this.env from WorkflowEntrypoint at runtime.
env
this.env
A TC39 class decorator.
import { instrumentWorkflow } from "@tigorhutasuhut/telemetry-js";@instrumentWorkflow({ serviceName: "my-workflow" })export class MyWorkflow extends WorkflowEntrypoint { async run(event: WorkflowEvent, step: WorkflowStep) { await step.do("fetch-data", async () => { ... }); }} Copy
import { instrumentWorkflow } from "@tigorhutasuhut/telemetry-js";@instrumentWorkflow({ serviceName: "my-workflow" })export class MyWorkflow extends WorkflowEntrypoint { async run(event: WorkflowEvent, step: WorkflowStep) { await step.do("fetch-data", async () => { ... }); }}
TC39 class decorator that instruments a Cloudflare Workflow with OpenTelemetry tracing.
Intercepts the
runmethod to:traceparentfromevent.payloadfor cross-workflow propagationworkflow.runspan wrapping the entire executionstepobject with traced versions ofdo,sleep, andsleepUntil— nested step calls automatically become children of the outer step's span