-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Performance monitoring for Micro-frontends #9601
Comments
There is no way to make this work in the browser today, are they comfortable with introducing https://www.npmjs.com/package/zone.js as a dependency? Angular themselves are dropping Zone, so it may also not be developed for longer. Also I don't understand how this makes performance monitoring better - which micro-frontend do you associate with the span that represents the duration of loading JavaScript resource? What about CLS (layout shift) - which micro-frontend should you associate that metric to? By splitting up telemetry data this way you end up diluting the usefulness of the product IMO. |
@AbhiPrasad resources, and application-wide metrics like CLS stay in the host transaction of course
no splitting, but meaningful end to end duration-like metric for each MFE and a span subtree for each MFE @nanoburd mentioned this may be solved by some new performance model (span-only?) we have in the works |
Unfortunately we're blocked not just by spans only model but by core browser APIs to enforce parent-child behaviour. We also have the issue that splitting up spans this way will make associating to profiles and replays much harder (and more confusing), plus distributed tracing will get more complicated as each subtree theoretically gets its own trace to remain truly isolated. Splitting up a span tree based on microfrontends feels like an artificial boundary, like only looking at a flamegraph based on what modules your team owns. It puts barriers to solving your performance problems and I'd rather avoid introducing that pattern if possible. At the end of the day automatic instrumentation cannot guarantee attaching it's spans to the correct parent in the browser, and we're a while away till |
Thank you for the explanation @AbhiPrasad . Looks like I seriously underestimated the complexity of this. Sounds like doing this would be:
This said, I still feel like we could do something simpler to improve performance experience for MFE use case. |
Yes, because at the end of the day, its all JS running on a single process on the main thread - everything has consequences on everything else.
This might be possible, we have some ongoing discussions to do this for queries getsentry/team-sdks#40, but we need to take care of overhead concerns. Generating and parsing error stacktraces is expensive, especially on a per span basis. We can't easily attach this info to browser/resource spans though because they are generated by the browser, not from user code, and certain async tasks like fetch requests may not even get the correct line of code. |
I'm going to close this because this is a use case we don't support in the browser SDK atm. Once support for https://github.com/tc39/proposal-async-context is released across the browsers, we can attempt to fix this again! |
Problem Statement
2 customers are interested in having a solution to measuring performance in micro-frontend architectures.
An acceptable solution would capture each micro-frontend from loading, through rendering to being fully initialized as a parent span (and possibly a custom metric or DDM), making sure that all spans involved in initializing it are captured as child spans. As of today child spans from different micro-frontends would be lost in the "soup" of spans from all other MFEs. An acceptable solution should not require extensive custom instrumentation. A good solution would be easy to configure and work out-of-the box.
Solution Brainstorm
I understand this is not currently possible in v7 due to lack of scope isolation.
A highly manual, complex solution may be possible with custom instrumentation (currently evaluating feasibility).
Related
┆Issue is synchronized with this Jira Improvement by Unito
The text was updated successfully, but these errors were encountered: