Skip to content

[Cloudflare workflows] Dedicated span do not show up in error reports #17419

@Mael-Abgrall

Description

@Mael-Abgrall

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/cloudflare

SDK Version

10.3.0

Framework Version

No response

Link to Sentry event

https://ansearch.sentry.io/traces/trace/490b74c4ebdf422880ad494ec5500f27/?end=2025-08-16T01%3A23%3A57&mode=samples&node=span-bca03ce942e255f4&pageEnd=Sat%20Aug%2016%202025%2002%3A23%3A57%20GMT%2B0100%20%28British%20Summer%20Time%29&pageStart=Wed%20Aug%2013%202025%2002%3A23%3A57%20GMT%2B0100%20%28British%20Summer%20Time%29&project=-1&query=trace%3A490b74c4ebdf422880ad494ec5500f27&source=traces&start=2025-08-13T01%3A23%3A57&statsPeriod&table=trace&timestamp=1755178643.709

Reproduction Example/SDK Setup

Nested manual spans as described here: https://docs.sentry.io/platforms/javascript/guides/cloudflare/tracing/span-metrics/#creating-dedicated-metric-spans are not showing up in error traces.

I'm facing some deep issues in my workflows, and using the spans to debug what is happening. To do so, I'm nesting spans (one span for multiple step.do that are related)

The issue is none of those nested span are showing up in the dashboard, making it impossible to track what is going on

Steps to Reproduce

class WorkflowIngestBase extends WorkflowEntrypoint<
  Cloudflare.Env,
  IngestionWorkflowParameters
> {
  async run(
    event: WorkflowEvent<IngestionWorkflowParameters>,
    step: WorkflowStep,
  ): Promise<void> {
    const page = step.do('fetch page'() => {...})

    for (const item in page.item){
      Sentry.startSpan(
        {
          name: 'my custom span',
          attributes: {
            pageID: page.id,
          }
        },
        async () => {
          await step.do('process page item', async () => {...})
          await step.do('save item', async () => {...})
        }
      );
    }
  }
}

export const WorkflowIngest = SentryCloudflare.instrumentWorkflowWithSentry(
  (_environment: Cloudflare.Env) => {
    return {
      dsn: '...',
      ...customSentryConfig,
    };
  },
  WorkflowIngestBase,
);

Expected Result

(in Sentry)

Trace
|- step.do fetch page
|- my custom span
| |- step.do process item
| |- step.do save item
|- my custom span
| |- step.do process item
| |- step.do save item
| ...

Actual Result

(in Sentry)

Trace
|- step.do fetch page
|- step.do process item
|- step.do save item
|- step.do process item
|- step.do save item

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions