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:
Joakim Jäderberg
2025-06-19 08:28:53 +00:00
parent 46e7f33ab6
commit 3af994b0a9
5 changed files with 65 additions and 12 deletions
@@ -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;