sentry: Don't create spans for the longpoll or presence.

These will help Sentry skip span creation for these requests, which
are background events and not part of the pageload time.
This commit is contained in:
Alex Vandiver 2023-04-12 15:24:27 +00:00 committed by Tim Abbott
parent 37c3cfb348
commit 8089cb70dd
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,10 @@ if (page_params.server_sentry_dsn) {
name: normalize_path(location.pathname, sentry_key === "www"),
};
},
shouldCreateSpanForRequest(url) {
const parsed = new URL(url, window.location.href);
return !["/json/events", "/json/users/me/presence"].includes(parsed.pathname);
},
}),
],
allowUrls: url_matches,