Skip to content

Traces no longer encapsulates multiple spans #18401

@MitP1997

Description

@MitP1997

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/cloudflare - hono

SDK Version

10.28.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

I have my hono app wrapped within Sentry.withSentry with tracesSampleRate set to 1.
I also have the below code in the handler wrapped inside withSentry

    const sentryTrace = request.headers.get('sentry-trace') ?? undefined;
    const baggage = request.headers.get('baggage') ?? undefined;

    return Sentry.continueTrace({ sentryTrace, baggage }, async () => {
      // All spans created inside here should use the incoming trace context
      const response = (await app!.fetch(
        request as unknown as Request,
        env,
        ctx,
      )) as unknown as CloudflareResponse;
      return response;
    });

Steps to Reproduce

  1. Setup hono app using withSentry
  2. Setup continueTrace using the headers baggage and sentry-trace forwarded by the client
  3. Attempt a request from client to hono backend deployed on cloudflare

Expected Result

Expecting a distributed trace that shows the entire timeline from client to backend and back.

Actual Result

Earlier on 10.11.0, I had withSentry without continueTrace. While enabling distributed tracing using continueTrace, found this issue. Thus, installed the latest version 10.28.0 which has a fix for it.

Check the below screenshot

  1. Highlighted in green box is tracing on 10.11.0 without continueTrace
  2. Highlighted in red box is tracing on 10.28.0 with continueTrace, which splits up the trace into multiple 1 for every span.
Image

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions