File tree 1 file changed +3
-3
lines changed
platform-includes/performance/automatic-instrumentation-custom-routing
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ Sentry.init({
15
15
],
16
16
});
17
17
18
+ const client = Sentry .getClient ()
19
+
18
20
// We start the pageload span as early as possible!
19
- let pageLoadSpan = Sentry .startBrowserTracingPageLoadSpan ({
21
+ let pageLoadSpan = Sentry .startBrowserTracingPageLoadSpan (client, {
20
22
name: window .location .pathname ,
21
23
attributes: {
22
24
[Sentry .SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ]: " url" ,
@@ -25,8 +27,6 @@ let pageLoadSpan = Sentry.startBrowserTracingPageLoadSpan({
25
27
26
28
// Somewhere, instrument your router like this:
27
29
myRouter .on (" routeChange" , (route ) => {
28
- const client = Sentry .getClient ();
29
-
30
30
// Make sure that the pageload span uses the route name
31
31
// After that, each route change should trigger a navigation span (which will automatically finish the previous one)
32
32
if (pageLoadSpan) {
You can’t perform that action at this time.
0 commit comments