-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45c4e08
commit 0af294f
Showing
20 changed files
with
318 additions
and
39 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+332 KB
.yarn/cache/@sentry-internal-tracing-npm-7.89.0-eca0baebf6-010b5b6d9b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -28,6 +28,9 @@ const loadConfig = () => { | |
} | ||
: false, | ||
}, | ||
sentry: { | ||
dsn: process.env.SENTRY_DSN, | ||
}, | ||
}; | ||
}; | ||
|
||
|
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,29 @@ | ||
import * as Sentry from '@sentry/node'; | ||
import { CaptureConsole } from '@sentry/integrations'; | ||
import { mainConfig } from '../config/config.js'; | ||
import { logger } from './logger.js'; | ||
|
||
type Primitive = number | string | boolean | bigint | symbol | null | undefined; | ||
export const setSentryTag = (key: string, value: Primitive) => { | ||
Sentry.configureScope(scope => { | ||
scope.setTag(key, value); | ||
}); | ||
}; | ||
|
||
export const initializeSentry = () => { | ||
if (!mainConfig.sentry) { | ||
logger.warn(`Config variable "sentry" not set. Errors will not be sent to Sentry!`); | ||
} else { | ||
Sentry.init({ | ||
dsn: mainConfig.sentry.dsn, | ||
release: process.env.BUILD_COMMIT, | ||
environment: process.env.NODE_ENV ?? 'unknown', | ||
integrations: [ | ||
new CaptureConsole({ | ||
levels: ['error'], | ||
}), | ||
], | ||
tracesSampleRate: 1, | ||
}); | ||
} | ||
}; |
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