mirror of
https://github.com/versia-pub/versia-go.git
synced 2026-03-13 20:49:15 +01:00
chore: init
This commit is contained in:
commit
320715f3e7
174 changed files with 42083 additions and 0 deletions
28
web/src/instrument.ts
Normal file
28
web/src/instrument.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import * as Sentry from "@sentry/react";
|
||||
import {ENVIRONMENT, SENTRY_DSN} from "./env.ts";
|
||||
import {router} from "./routing.ts";
|
||||
|
||||
const sampleRate =
|
||||
ENVIRONMENT === "development" ? 1 : ENVIRONMENT === "staging" ? 0.5 : 0.2;
|
||||
|
||||
Sentry.init({
|
||||
dsn: SENTRY_DSN,
|
||||
environment: ENVIRONMENT,
|
||||
sampleRate,
|
||||
tracesSampleRate: 1.0,
|
||||
// TODO: Add more targets
|
||||
tracePropagationTargets: [/^\//, /^http(s)?:\/\/localhost\//],
|
||||
profilesSampleRate: 1.0,
|
||||
integrations: [Sentry.tanstackRouterBrowserTracingIntegration(router)],
|
||||
});
|
||||
|
||||
if (SENTRY_DSN) {
|
||||
console.log(
|
||||
"Sentry initialized with DSN",
|
||||
SENTRY_DSN,
|
||||
"and environment",
|
||||
ENVIRONMENT,
|
||||
);
|
||||
} else {
|
||||
console.warn("Sentry not initialized because no DSN is set");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue