-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): collect errors + warnings with @sentry/node (#8571)
* feat(build): add @sentry/node Note: This will only capture build errors. * feat(build/sentry): capture console.warn/error/assert() calls * chore(build/sentry): default to dev environment * chore(workflows): enable Sentry in {prod,stage}-build * chore(sentry): set SENTRY_RELEASE
- Loading branch information
Showing
8 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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,15 @@ | ||
import Sentry from "@sentry/node"; | ||
import { CaptureConsole } from "@sentry/integrations"; | ||
|
||
export function initSentry( | ||
dsn: string, | ||
options?: Omit<Sentry.NodeOptions, "dsn" | "environment" | "integrations"> | ||
) { | ||
Sentry.init({ | ||
dsn, | ||
environment: process.env.SENTRY_ENVIRONMENT || "dev", | ||
integrations: [new CaptureConsole({ levels: ["warn", "error", "assert"] })], | ||
tracesSampleRate: 1.0, | ||
...options, | ||
}); | ||
} |
This file contains 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 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 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 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