Skip to content

Can't record custom spans with @sentry/astro #16316

Open
@dowski

Description

@dowski

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/astro

SDK Version

9.19.0

Framework Version

5.7.13

Link to Sentry event

No response

Reproduction Example/SDK Setup

Here's an Astro starter repo with the Sentry integration setup as per the instructions on the Sentry site.

https://github.com/dowski/sentry-tracing-bug

You might need your own secret+DSN configured, but after that npm run dev should let you try it out.

Steps to Reproduce

  1. Create a new Astro site with npm create astro@latest
  2. Follow the Sentry instructions to add Sentry w/ tracing
  3. Verified that error logging works
  4. Added custom trace code
  5. Reloaded the page

In the console log I added, I see my span typed as SentryNonRecordingSpan. I also see a warning: "Multiple browserTracingIntegration instances are not supported."

Expected Result

My custom bar span is visible in the Sentry dashboard.

Actual Result

I see lots of Astro trace spans, but not my custom one. I've tried this on a couple different times with fresh projects and I get the same result. Here's a link to a sample trace in case you can view it internally.

https://timelinedesign.sentry.io/traces/trace/d8cc48a9f65646d2a5d64506cf7f95f4/?mode=samples&pageEnd&pageStart&project=4509334607167488&query=&sort=-span.duration&source=traces&statsPeriod=14d&table=trace&timestamp=1747426373.733

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions