2024-07-24 18:10:29 +02:00
|
|
|
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,
|
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-24 18:10:29 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const sentry = sentryInstance || undefined;
|