Skip to content

No isolation scope forking for async background tasks #19596

Description

@nicohrubec

We currently do not fork isolation scopes for async background tasks in nestjs. That's why any Sentry data generated during these tasks get written to the default isolation scope, which then gets forked during http requests. Therefore data generated during async activity leaks into http requests (see for instance leaking breadcrumbs). We need to ensure that we properly isolate async background tasks.

Solution Brainstorm: We could try to find a single entrypoint but it would be good to write new instrumentations for the most important use cases here anyway (to also capture errors and do some tracing). For @nestjs/event-emitter we have instrumentation already, so we just need to add an isolation scope for other setups this is lacking (tracked in JS-1895).

Reproduction

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions