mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat: ✨ Add Sentry support
This commit is contained in:
parent
0679971cc0
commit
5061735da7
8 changed files with 57 additions and 0 deletions
18
utils/sentry.ts
Normal file
18
utils/sentry.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as Sentry from "@sentry/bun";
|
||||
import { config } from "config-manager";
|
||||
import pkg from "~/package.json";
|
||||
|
||||
const sentryInstance =
|
||||
config.logging.sentry.enabled &&
|
||||
Sentry.init({
|
||||
dsn: config.logging.sentry.dsn,
|
||||
debug: config.logging.sentry.debug,
|
||||
sampleRate: config.logging.sentry.sample_rate,
|
||||
maxBreadcrumbs: config.logging.sentry.max_breadcrumbs,
|
||||
tracesSampleRate: config.logging.sentry.traces_sample_rate,
|
||||
environment: config.logging.sentry.environment,
|
||||
tracePropagationTargets: [config.http.bind],
|
||||
release: pkg.version,
|
||||
});
|
||||
|
||||
export const sentry = sentryInstance || undefined;
|
||||
Loading…
Add table
Add a link
Reference in a new issue