Merged in feat/redis-api-send-logs (pull request #2290)
feature: send logs to Sentry for Redis-Api * feature: send logs to Sentry for Redis-Api Approved-by: Linus Flood
This commit is contained in:
@@ -4,10 +4,25 @@ import * as Sentry from "@sentry/bun";
|
||||
|
||||
import { env } from "@/env";
|
||||
|
||||
Sentry.init({
|
||||
const s = Sentry.init({
|
||||
dsn: env.SENTRY_DSN,
|
||||
enabled: env.SENTRY_ENABLED,
|
||||
environment: env.SENTRY_ENVIRONMENT,
|
||||
tracesSampleRate: env.SENTRY_TRACE_SAMPLE_RATE,
|
||||
release: env.VERSION,
|
||||
_experiments: {
|
||||
enableLogs: true,
|
||||
beforeSendLog(log) {
|
||||
const ignoredLevels: (typeof log.level)[] = ["debug", "trace"];
|
||||
if (ignoredLevels.includes(log.level)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return log;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
||||
export const sentry = s!;
|
||||
export const SentryLogger = Sentry.logger;
|
||||
|
||||
Reference in New Issue
Block a user