From d14c265ae2a66d784d193692986e5e93ae4e87d0 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Tue, 17 Jan 2023 10:28:53 +0100 Subject: [PATCH] Include dashboard sentry integration script --- assets/js/dashboard/sentry.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 assets/js/dashboard/sentry.js diff --git a/assets/js/dashboard/sentry.js b/assets/js/dashboard/sentry.js new file mode 100644 index 000000000..5b809d478 --- /dev/null +++ b/assets/js/dashboard/sentry.js @@ -0,0 +1,18 @@ +import * as Sentry from "@sentry/react"; +import { Integrations } from "@sentry/tracing"; + +const container = document.getElementById('stats-react-container') + +Sentry.init({ + dsn: container.dataset.sentryDsn, + environment: container.dataset.environment, + integrations: [new Integrations.BrowserTracing()], + release: container.dataset.sentryRelease || "unknown", + initialScope: { + tags: { + 'app_version': container.dataset.sentryRelease, + 'origin': 'dashboard' + }, + }, + tracesSampleRate: 0.5, +});