browser-sdk: Error Tracking with single-spa / micro frontends
Hey folks,
We try to get Datadog RUM working with micro-frontends, where we have multiple micro frontend applications running on one page.
The setup we’ve tried:
- the single HTML file shared by all apps instantiates one BrowserSdk instance with one Datadog application & service
- each mfe application is reflected as a service on Datadog and uploading sourcemaps for its releases and service
- we disabled automated view tracking and instead each mfe app dispatches those manually to override the service attribute
But this does not seem to support multiple services on one page load, because the application stats, bundling all services, would be screwed as one page load emits multiple view events and events descending the view event, like error events, would be linked to the view event last dispatched on that page.
So when one page loads 3 or 4 applications, each reflected as a service on DD, we would only be able to properly monitor one of these. But it seems worse for uncaught, asynchronous errors bubble up to window.onerror where they would become logged by the connected service, where they however do not fit in and hence create noise.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 12
- Comments: 25 (1 by maintainers)
@robmosca we actually got it working. We treat all our micro frontends as a monolith, centralising source maps on AWS and providing a composed version to Datadog, as well as our FE Datadog client. So we have one DD application and have build dashboards and query views that use the view path group to cover the applications owned by different teams.
I’ve never written a blog post, but if needed I can give it a try.
Hi everyone 😃 I’m part of Datadog’s RUM team, and in order to better understand the needs around Microfrontend support, we created a survey so we can gather your feedback. If you are concerned by this topic and want to help us create a better experience for you could you take 5 minutes and fill it out? The link is below: https://app.ballparkhq.com/record/192df656-cf60-41f1-92d0-83d67d2eb694 Dont hesitate to reach out to me if you have any questions ! Thank you !!
Hey @robmosca, it is still an area that we would want to better support, we have some further investigations planned in the short term to see how we could provide more help for those cases. We will keep you posted here.
@PaulKujawa thanks for the suggestion, we’ll keep this use case in mind and evaluate possible approaches when we will prioritise this topic.
MFEs should be first-class citizens. E.G. just like there’s a dependency map in
APM -> Service MapMFEs and UI components should be part of that mapFor reference, Sentry supports automatically fetching sourcemaps. This is our biggest blocker for migrating off of Sentry to Datadog.
https://docs.sentry.io/platforms/javascript/sourcemaps/
Hi again everyone!
Thank you to those of you who answered our survey, the feedback was extremely useful. We are currently in the technical exploration phase and are considering a few options. If you want to help us further, you can help us rank these options by completing the following survey: https://www.userinterviews.com/projects/WjBK2WmPlg/apply
Due to the nature of these technical explorations we ask participants to this survey to fill out an NDA, but the first 30 to complete it get $10 as a token of our gratitude 😃
Looking forward to hearing from you !!
It is not something that we support for now, we may consider it but that would require more thoughts on our side.
Do you mean on the SDK side? If yes, it is probably not something that we will want to invest on, given the potential complexity and performance impact.