Skip to content

Loading the BrowserTracing integration separately and ensure Sentry is loaded lazily #15386

@gilisho

Description

@gilisho

Problem Statement

We are using Sentry major 7 on a micro-frontend environment. We load Sentry using Loader script.

We want to be able to use Sentry's SDK method of startSpan/startSpanManual in order to report interesting transactions and monitor them via Sentry.
According to the docs, this requires loading the specific bundle of tracing, e.g. https://browser.sentry-cdn.com/7.120.3/bundle.tracing.min.js as described here.

Our problem with this requirement is that we would still want to load Sentry lazily, as if I'm using error-only features. Only if there is a use of startSpan or startSpanManual for example, the Sentry bundle would fully load.
We want to monitoring only the transactions reported via startSpan/startSpanManual.

Is there a way to achieve that and workaround the current limitation?
Thank you very much!

Solution Brainstorm

We are thinking about loading the non-tracing bundle and maybe load BrowserTracing integration bundle separately. Not sure If this is going to work (I can create a PR to add a bundle of this integration, as I previously did for ModuleMetadata here and here).
Would love your feedback regarding the possibility of this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions