2024-07-24 18:10:29 +02:00
|
|
|
import * as Sentry from "@sentry/bun";
|
2025-02-15 02:47:29 +01:00
|
|
|
import { config } from "~/config.ts";
|
2024-07-24 18:10:29 +02:00
|
|
|
import pkg from "~/package.json";
|
|
|
|
|
|
|
|
|
|
const sentryInstance =
|
2025-02-15 02:47:29 +01:00
|
|
|
config.logging.sentry &&
|
2024-07-24 18:10:29 +02:00
|
|
|
Sentry.init({
|
2025-02-15 02:47:29 +01:00
|
|
|
dsn: config.logging.sentry.dsn.origin,
|
2024-07-24 18:10:29 +02:00
|
|
|
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,
|
2024-07-26 00:02:48 +02:00
|
|
|
tracePropagationTargets:
|
|
|
|
|
config.logging.sentry.trace_propagation_targets,
|
2024-07-26 00:20:58 +02:00
|
|
|
release: Bun.env.GIT_COMMIT
|
|
|
|
|
? `${pkg.version}-${Bun.env.GIT_COMMIT}`
|
|
|
|
|
: pkg.version,
|
2024-07-27 22:44:21 +02:00
|
|
|
integrations: [Sentry.extraErrorDataIntegration()],
|
2024-07-24 18:10:29 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const sentry = sentryInstance || undefined;
|