@tigorlazuardi/otel-cloudflare - v1.1.1
    Preparing search index...

    Function traceWorkflow

    • Decorator to add tracing to Cloudflare Workflow classes

      Automatically:

      • Initializes OTLP collectors and flushes on completion
      • Stores traceparent in deterministic step (persists across pause/resume)
      • Extracts traceparent from payload._traceparent or generates new one
      • Proxies step methods to create child spans for each step

      Type Parameters

      • Env = unknown
      • Params = unknown

      Returns <T extends WorkflowEntrypointConstructor<Env, Params>>(
          target: T,
          context: ClassDecoratorContext,
      ) => T

      @traceWorkflow()
      export class MyWorkflow extends WorkflowEntrypoint<Env, Params> {
      async run(event: WorkflowEvent<Params>, step: WorkflowStep) {
      await step.do("fetch-data", async () => {
      // This step is automatically traced
      });
      }
      }