Skip to content

Commit 5dbd9fe

Browse files
committed
chore: improve sentry logs
1 parent 8bbf5e3 commit 5dbd9fe

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

api/src/instrument.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ if (env.sentryDsnApi) {
1414
tracesSampleRate: 1.0,
1515
sendDefaultPii: true
1616
});
17+
console.info(`Sentry initialized (environment: ${env.environment}, release: ${projectVersion})`);
18+
} else {
19+
console.info(`Sentry not initialized - no DSN configured (environment: ${env.environment})`);
1720
}

web/src/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,21 @@ if (import.meta.env.SENTRY_DSN_WEB) {
1717
environment: import.meta.env.ENVIRONMENT,
1818
release: projectVersion,
1919
sendDefaultPii: true,
20-
integrations: [Sentry.replayIntegration()],
20+
tracesSampleRate: 1.0,
21+
integrations: [
22+
Sentry.browserTracingIntegration({ nam }),
23+
Sentry.replayIntegration()
24+
],
2125
replaysSessionSampleRate: 0.01,
2226
replaysOnErrorSampleRate: 1.0
2327
});
28+
console.info(
29+
`Sentry initialized (environment: ${import.meta.env.ENVIRONMENT}, release: ${projectVersion})`
30+
);
31+
} else {
32+
console.info(
33+
`Sentry not initialized - no DSN configured (environment: ${import.meta.env.ENVIRONMENT})`
34+
);
2435
}
2536

2637
startReactDsfr({ defaultColorScheme: "system" });

web/src/vite-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ declare module "*.svg" {
1818
type ImportMetaEnv = {
1919
// Auto-generated by `npx vite-envs update-types` and hot-reloaded by the `vite-env` plugin
2020
// You probably want to add `/src/vite-env.d.ts` to your .prettierignore
21+
VITE_HEAD: string
2122
BASE_URL: string
2223
MODE: string
2324
DEV: boolean
2425
PROD: boolean
25-
VITE_HEAD: string
2626
ENVIRONMENT: string
2727
VERSION: string
2828
NODE_ENV: string

0 commit comments

Comments
 (0)