Skip to content

feat: Add docs for custom browser tracing routing instrumentation #9113

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

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 12, 2024

This fixes one forgotten line in the react docs, and adds a section to react & browser auto-instrument docs on how to implement your own navigation instrumentation using the new APIs.

@mydea mydea requested review from lforst, Lms24 and AbhiPrasad February 12, 2024 16:16
@mydea mydea self-assigned this Feb 12, 2024
Copy link

vercel bot commented Feb 12, 2024

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 Feb 14, 2024 9:59am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
sentry-docs-next ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2024 9:59am

});

// Somewhere, instrument your router like this:
myRouter.on("routeChange", (route) => {
Copy link
Member

Choose a reason for hiding this comment

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

We should add a note about setting correct route name for pageload as well, we want to avoid un-paramaterized transactions.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this is mostly about updating the pageload span, right? 🤔 or should we document how to emit a pageload span?

Copy link
Member

Choose a reason for hiding this comment

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

yeah updating the pageload span, I think most frameworks will be fine with emitting pageload as soon as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

I opened a PR: getsentry/sentry-javascript#10633 to make this easier, as documenting this showed that there is def. room for improvement there!

@@ -19,3 +19,5 @@ Sentry.init({
tracesSampleRate: 1.0,
});
```

<PlatformContent includePath="performance/automatic-instrumentation-custom-routing" />
Copy link
Member

@Lms24 Lms24 Feb 13, 2024

Choose a reason for hiding this comment

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

l: should this documentation live under "Automatic Instrumentation"? Isn't this rather fitting for "Custom Instrumentation"?

I guess there's a case for both, given we're mentioning browserTracingIntegration directly above but maybe it's enough to link to custom from the "Autmatic Instrumentation" page

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, IMHO I'd generally restructure this a bit in a follow up - we should rethink this with a bit of time! Currently that's basically the "browser tracing" page, in reality, even though the name is not necessarily clear on that.

@mydea
Copy link
Member Author

mydea commented Feb 13, 2024

I have updated this based on the changes in v7.101.0. Now it is a "full" example including updating the pageload span.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

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

LGTM, just a few small tweaks

Co-authored-by: Liza Mock <liza.mock@sentry.io>
@mydea mydea enabled auto-merge (squash) February 14, 2024 09:38
@mydea mydea merged commit 159202d into master Feb 14, 2024
@mydea mydea deleted the fn/custom-browser-tracing-routing branch February 14, 2024 09:53
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2024
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.

4 participants