Skip to content

Module Federated Apps - Do not capture everything #16068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
ghlLarney opened this issue Apr 15, 2025 · 7 comments
Closed
3 tasks done

Module Federated Apps - Do not capture everything #16068

ghlLarney opened this issue Apr 15, 2025 · 7 comments

Comments

@ghlLarney
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

7.107.0

Framework Version

No response

Link to Sentry event

https://gohighlevel.sentry.io/insights/frontend/?end=2025-03-05T23%3A29%3A59&environment=production&project=4507072894402560&start=2025-03-05T00%3A00%3A00&utc=true

Reproduction Example/SDK Setup

Current Setup:

  1. We have a micro-frontend architecture with:
    • Main application in Vue 2 (mother app)
    • Multiple micro-apps in Vue 3 (loaded via module federation)
    • Using vue-composition-api to make Vue 3 code compatible with Vue 2
  2. Sentry Configuration:
    • Single Sentry initialization in the main app
    • Separate DSNs for each micro-app for isolated error tracking
    • Using sentry-vue SDK

Steps to Reproduce

NA

Expected Result

  1. Transaction Visibility:
    • Transactions from micro-frontends are not properly linked with the main app
    • User journey tracking is fragmented
    • Spans and breadcrumbs from different apps appear as separate traces instead of being unified
  2. We want all monitoring data (spans, breadcrumbs, transactions) from both the main app and micro-frontends to appear under a single trace for better visibility into the complete user journey.
  3. Would upgrading the sentry-vue SDK version help resolve this issue of fragmented tracing?

Actual Result

Image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 15, 2025
@github-actions github-actions bot added the Package: vue Issues related to the Sentry Vue SDK label Apr 15, 2025
@lforst
Copy link
Contributor

lforst commented Apr 15, 2025

You can not use performance monitoring in micro frontends when you instrument performance monitoring in the main app. This is a limitation. Only instrument performance monitoring once per page!

@ghlLarney
Copy link
Author

Thanks for the response @lforst
Can't we get breadcrumbs or spans out of micro frontend?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 15, 2025
@ghlLarney
Copy link
Author

Also, if this is a limitation today, can we get to a work around where we pass events from microapp to main app?

@Lms24
Copy link
Member

Lms24 commented Apr 16, 2025

Also, if this is a limitation today, can we get to a work around where we pass events from microapp to main app?

The first thing coming to my mind would be to pass a reference of the main Sentry scope/client to your micro apps and directly call scope.startSpan(...) on these. Auto instrumentation won't work in this setting.

@lforst
Copy link
Contributor

lforst commented Apr 16, 2025

@ghlLarney
Copy link
Author

Yes, I've gone through the documentation you've shared. Interestingly the second last paragraph is something which makes it possible right?

Starting with version 8.7.0, if you have multiple Sentry JavaScript SDKs on the same page, they only interact with each other if they're using the same version. This prevents unwanted cross-SDK interactions, where calls or accesses to recently added or no longer existing SDK APIs would lead to errors. A classic example for this are browser extensions or 3rd party scripts using Sentry when the host app also uses Sentry.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 16, 2025
@lforst
Copy link
Contributor

lforst commented Apr 16, 2025

Errors tracking: possible.
Performance tracking: not possible. (Actually, it is possible but not in granular MFE fashion - only host app)

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Apr 16, 2025
@stephanie-anderson stephanie-anderson added the Vue label May 2, 2025 — with Linear
@stephanie-anderson stephanie-anderson removed the Package: vue Issues related to the Sentry Vue SDK label May 2, 2025
@linear linear bot added the Bug label May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants