Skip to content

[NestJS] Leaking breadcrumbs #17742

@dalnoki

Description

@dalnoki

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nestjs

SDK Version

^10.2.0

Framework Version

10.x

Link to Sentry event

No response

Reproduction Example/SDK Setup

The customer is seeing breadcrumbs from clearly unrelated, earlier requests (minutes before) appear on current events. This suggests request isolation isn’t working as expected.

Steps to Reproduce

We’re seeing very long breadcrumb histories in a NestJS service — breadcrumbs from clearly unrelated, earlier requests (minutes before) appear on current events. This suggests request isolation isn’t working as expected.

  • They verified that Sentry is imported first
  • They Implemented a custom NestJS middleware that starts a new isolation context at the beginning of each request. This seems to resolve the issue.

Expected Result

The SDK should do the isolation automatically

Actual Result

Breadcrumbs are not isolated properly

Additional Context

Tip: 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

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions