Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: do not report unauthorized error to sentry (#2480)

Max Deichmann0b7fd5e70e98
diff --git a/web/src/pages/api/public/ingestion.ts b/web/src/pages/api/public/ingestion.ts
index 3a250c806b..1f17fe013d 100644
--- a/web/src/pages/api/public/ingestion.ts
+++ b/web/src/pages/api/public/ingestion.ts
@@ -136,7 +136,9 @@ export default async function handler(
} catch (error: unknown) {
console.error("error handling ingestion event", error);
- Sentry.captureException(error);
+ if (!(error instanceof UnauthorizedError)) {
+ Sentry.captureException(error);
+ }
if (error instanceof BaseError) {
return res.status(error.httpCode).json({
diff --git a/web/src/sentry.server.config.ts b/web/src/sentry.server.config.ts
index 69a653d44d..568cafec4b 100644
--- a/web/src/sentry.server.config.ts
+++ b/web/src/sentry.server.config.ts
@@ -10,24 +10,7 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN)
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
- tracesSampler: (samplingContext) => {
- if (
- samplingContext.request &&
- samplingContext.request.url &&
- samplingContext.request.url.includes("api/trpc")
- ) {
- return 0.1;
- }
- if (
- samplingContext.request &&
- samplingContext.request.url &&
- samplingContext.request.url.includes("api/auth")
- ) {
- return 0.1;
- }
- return 0.1;
- },
-
+ tracesSampleRate: 0.5,
profilesSampleRate: 0.1,
integrations: [
// Add profiling integration to list of integrations