Skip to content

Commit 21aa2fd

Browse files
andreiborzavivianyentran
authored andcommitted
docs(browser): Add missing client param to startBrowserTracingPageLoadSpan (#10215)
1 parent 809b5fa commit 21aa2fd

File tree

1 file changed

+3
-3
lines changed
  • platform-includes/performance/automatic-instrumentation-custom-routing

1 file changed

+3
-3
lines changed

platform-includes/performance/automatic-instrumentation-custom-routing/javascript.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ Sentry.init({
1515
],
1616
});
1717

18+
const client = Sentry.getClient()
19+
1820
// We start the pageload span as early as possible!
19-
let pageLoadSpan = Sentry.startBrowserTracingPageLoadSpan({
21+
let pageLoadSpan = Sentry.startBrowserTracingPageLoadSpan(client, {
2022
name: window.location.pathname,
2123
attributes: {
2224
[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
@@ -25,8 +27,6 @@ let pageLoadSpan = Sentry.startBrowserTracingPageLoadSpan({
2527

2628
// Somewhere, instrument your router like this:
2729
myRouter.on("routeChange", (route) => {
28-
const client = Sentry.getClient();
29-
3030
// Make sure that the pageload span uses the route name
3131
// After that, each route change should trigger a navigation span (which will automatically finish the previous one)
3232
if (pageLoadSpan) {

0 commit comments

Comments
 (0)