chore: init

This commit is contained in:
DevMiner 2024-08-11 03:51:22 +02:00
commit 320715f3e7
174 changed files with 42083 additions and 0 deletions

28
web/src/instrument.ts Normal file
View 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");
}