Skip to content

Dynamically loading sample rates based on MicroFE #14469

Open

Description

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.118.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

Code available here: https://www.notion.so/sentry/Dynamically-loading-sample-rates-based-on-MicroFE-1428b10e4b5d80ec85f3e470eb8ae9b9

Steps to Reproduce

Following the documentation here: Manually Route Errors to Different Projects,

We are calling thegetEvent()function within dsnFromFeature. This function parses the event's URL using a regex and returns a JSON object from a file containing the corresponding DSN key.

In addition to returning the DSN key, we would also like to include sample rates (for errors, transactions, and replays) associated with each DSN. This will allow us to dynamically initialize the Sentry SDK with those values.

Expected Result

Each micro-frontend (microFE) is dynamically adjusted based on the configuration specified in the JSON file, including the DSN key and sample rates for errors, transactions, and replays.

Actual Result

getEvent() is undefined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions