Skip to content

feat(js): Add micro-frontend docs#6754

Merged
AbhiPrasad merged 4 commits intomasterfrom
abhi-micro-frontend-docs
May 2, 2023
Merged

feat(js): Add micro-frontend docs#6754
AbhiPrasad merged 4 commits intomasterfrom
abhi-micro-frontend-docs

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Contributor

Closes getsentry/sentry-javascript#7622

Adds preliminary docs for using the multiplexed transport introduced with getsentry/sentry-javascript#7926 for the micro-frontends use case.

Adds a warning about async context support meaning that we cannot isolate breadcrumbs/spans.

@AbhiPrasad AbhiPrasad self-assigned this Apr 27, 2023
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2023 0:08am

@AbhiPrasad AbhiPrasad requested review from a team, lforst and mydea and removed request for a team April 27, 2023 15:43
@AbhiPrasad AbhiPrasad marked this pull request as ready for review April 27, 2023 15:43
Copy link
Copy Markdown
Contributor

@shanamatthews shanamatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language tweaks, style tweaks, fenced code block language standardization


init({
dsn: '__FALLBACK_DSN__',
transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random question but might be relevant to document: which ones are called first: the "matcher" ("dsnFromFeature") or the init's "beforeSend"?

As an example, if I enhance my event tags at init's beforeSend (e.g. I add "event.tags.feature = cart"), will the enhanced event tags be available at this matcher (i.e. at dsnFromFeature when getEvent() is called)?

Context: before this multiplexed transport feature is available, one workaround to send different event to different Sentry project is via beforeSend and initialize a BrowserClient there (https://github.com/sentry-demos/sentry-micro-frontend/blob/5996c4b528f58696b729db9d41f4962a83c53c77/methods/simple-remote.js#LL42C28-L42C28) So when implementing this mechanism at my company, my implementation actually adds more tags there than just finding out relevant DSN to send to (e.g. I added the micro app's release info). If I could access the tags added in "beforeSend" when the matcher is called, I could reduce some code duplication. However if that's not possible, it's also ok too for me.

Thanks~

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init's beforeSend is called before the matcher's dsnFromFeature. Will call this out in the docs - thanks for updating it!

AbhiPrasad and others added 2 commits May 2, 2023 13:54
Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) May 2, 2023 11:58
@AbhiPrasad
Copy link
Copy Markdown
Contributor Author

Thanks for the review @shanamatthews!

@AbhiPrasad AbhiPrasad merged commit 09d5fa4 into master May 2, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-micro-frontend-docs branch May 2, 2023 12:04
@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommended way to use micro-frontends with Sentry JS SDK

3 participants