-
Notifications
You must be signed in to change notification settings - Fork 0
Add sentry #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add sentry #170
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7be7ba4
feat: sentry added to backend
wfelliss a5a5033
feat: add frontent sentry
wfelliss 43f753b
Update apps/backend/src/instrument.ts
wfelliss 4ea8802
remove tracing
wfelliss 1f11e12
Merge branch 'add-sentry' of https://github.com/wfelliss/SDSD into ad…
wfelliss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import * as Sentry from "@sentry/nestjs"; | ||
|
|
||
| // Must be imported before any other module in main.ts so Sentry can | ||
| // instrument Node built-ins before NestJS loads them. Note: the backend | ||
| // runs under Bun, so OpenTelemetry auto-instrumentation is limited — | ||
| // error capture and manual spans work, automatic http/db spans may not. | ||
| Sentry.init({ | ||
| debug: process.env.NODE_ENV === "development", | ||
| dsn: process.env.SENTRY_DSN, | ||
| environment: process.env.SENTRY_ENVIRONMENT ?? "production", | ||
| release: process.env.SENTRY_RELEASE, | ||
| // Tracing intentionally disabled for now — errors and logs only | ||
| enableLogs: true, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| # Copy this to .env and update values for your environment (Railway, etc.) | ||
| VITE_API_BASE_URL="http://localhost:3001" | ||
| VITE_API_BASE_URL="http://localhost:3001" | ||
|
|
||
| # Sentry — get the DSN from sentry.io > Project Settings > Client Keys (DSN). | ||
| # The DSN is public-safe. VITE_ prefix exposes it to the browser bundle. | ||
| VITE_SENTRY_DSN="" | ||
| # Server-side (SSR) DSN — usually the same value | ||
| SENTRY_DSN="" | ||
| SENTRY_ENVIRONMENT="development" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,24 @@ | ||
| import * as Sentry from "@sentry/react-router"; | ||
| import { HydratedRouter } from "react-router/dom"; | ||
| import { startTransition, StrictMode } from "react"; | ||
| import { hydrateRoot } from "react-dom/client"; | ||
|
|
||
| Sentry.init({ | ||
| dsn: import.meta.env.VITE_SENTRY_DSN, | ||
| environment: import.meta.env.MODE, | ||
| // Tracing is intentionally disabled for now (no tracesSampleRate) — | ||
| // errors and replays only. Re-add reactRouterTracingIntegration() and | ||
| // trace meta-tag injection in entry.server.tsx when enabling it. | ||
| integrations: [Sentry.replayIntegration()], | ||
| replaysSessionSampleRate: 0.1, | ||
| replaysOnErrorSampleRate: 1.0, | ||
| }); | ||
|
|
||
| startTransition(() => { | ||
| hydrateRoot( | ||
| document, | ||
| <StrictMode> | ||
| <HydratedRouter /> | ||
| <HydratedRouter onError={Sentry.sentryOnError} /> | ||
| </StrictMode> | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import * as Sentry from "@sentry/react-router"; | ||
|
|
||
| // Server-side Sentry init — imported first in entry.server.tsx. | ||
| // (Direct import rather than NODE_OPTIONS --import so it works identically | ||
| // on Windows dev machines and the Railway deployment.) | ||
| Sentry.init({ | ||
| dsn: process.env.SENTRY_DSN, | ||
| environment: process.env.SENTRY_ENVIRONMENT ?? "production", | ||
| // Tracing intentionally disabled for now — errors and logs only | ||
| enableLogs: true, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.