-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Background
Micro frontends are inherently ambiguous outside of certain frameworks for MFE delivery (module federation for example). Ultimately users want to be able to keep their code and errors separated, to be able to understand where regressions might have occurred specifically and functionally to be able to route errors within their teams.
Proposal
With our webpack plugin it is possible during build time to add identifiers to the generated/built code. For example the debugIds added in Artifact Bundles.
Our webpack plugin similarly could inject unique id for code which should be respected as part of their own verticals. The SDK at runtime would then have access to these containerIds and could then be handled in beforeSend or similar, to route events generated to a specific DSN, add tags to be able to filter in the Sentry UI and more
- can use injected IDs to populate events with information maintained by bundler-plugin to store on events as context to send to sentry
- SDK will not make any automatic decision at this stage of routing (projects, teams, multiple projects or orgs etc)
- ensure the data is populated in Sentry and consumable via API
Consideration:
This work will be restricted to only webpack plugin for now, but it is important to note that something like this could be applied outside of webpack, and inversely more specifically focus on Module Federation concepts. Then further if it might be useful one day to have this upstream in Module Federation, webpack generically and other bundlers.
For now I think it would be the best interest of ourselves and users to try and conform namings we choose to match those used withing webpack Module Federation to make it easy to understand for casual and expert users alike.