figure-out-why-the-browser-data-is-not-being-collected-by-sentry-485 #492
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!492
Loading…
Reference in a new issue
No description provided.
Delete branch "figure-out-why-the-browser-data-is-not-being-collected-by-sentry-485"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR switches the Sentry browser SDK to the tracing bundle, adds the
BrowserTracingintegration, and bumpstracesSampleRatefrom0.0to1.0inbase.j2, while adding the same Sentry loader to two previously un-instrumented standalone templates (allpicksbase.j2,setting_up.j2). The wiring is correct for Sentry v7 and should get browser data flowing, but the 100% trace sample rate interacts badly with the auto-refreshing pages, and the instrumentation still misses the admin (v2) pages.Worth fixing
tracesSampleRate: 1.0on auto-refreshing pages will flood Sentry's performance quota.allpicksbase.j2:79reloads the page every 30s (setInterval('autoRefresh()', 30000)) andsetting_up.j2:7uses<meta http-equiv="refresh" content="60">. WithBrowserTracingat a 1.0 sample rate, every reload emits a full pageload transaction, so an open allpicks tab generates ~2 transactions/minute/viewer indefinitely, and the setup page 1/minute. On a metered Sentry plan that's a lot of continuous spend for little signal. Consider a low sample rate (e.g.0.1) or overriding it downward on the auto-refreshing templates.Admin (
v2) pages still collect no browser data. Allv2/admin*templates extendapp/templates/v2/base_v2.j2(see theextendsmatches), which has no Sentry loader (app/templates/v2/base_v2.j2:18<head>has none). If the goal is "figure out why browser data is not being collected," the admin surface remains uninstrumented. Either add the loader there too or note the omission is intentional.The Sentry init block is now duplicated verbatim across three templates (
base.j2:15-31,allpicksbase.j2:23-39,setting_up.j2:18-34). A single{% include "_sentry.j2" %}partial would keep the DSN, sample rate, and SDK version from drifting between copies — which matters directly given the sample-rate concern above (you'd otherwise have to fix it in three places).Nits
replaysSessionSampleRate: 0.0is a no-op here — noReplayintegration is loaded and the tracing bundle doesn't include Replay, so the setting has nothing to act on. Harmless, but misleading; drop it or add the integration if replays are actually wanted.data-lazy="no"(all three templates) is an attribute for Sentry's loader script; with the full CDN bundle it has no effect. Leftover from the loader approach.dsn,environment, andreleaseare interpolated straight into a JS string literal ({{ config.SENTRY_DSN }}, etc.). These are trusted config values so the risk is negligible, but a stray"or</script>in any of them would break the page; not worth changing unless you want defensiveness.The DSN being exposed client-side is expected and not a security issue — Sentry DSNs are designed to be public.