Skip to content

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

chore: enable sentry logging for backend errors (#10540)

Max Deichmannaa6a4efe7168
diff --git a/web/instrumentation-client.ts b/web/instrumentation-client.ts
index bd4bfac5f7..6441fe8da1 100644
--- a/web/instrumentation-client.ts
+++ b/web/instrumentation-client.ts
@@ -10,33 +10,10 @@ Sentry.init({
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
release: process.env.NEXT_PUBLIC_BUILD_ID,
- beforeSend(event, hint) {
- const error = hint.originalException;
+ beforeSend(event) {
+ // const error = hint.originalException;
const errorValue = event.exception?.values?.[0]?.value || "";
- // Filter out TRPCClientErrors, we track them in DataDog.
- // The users see those via toast notifications -> see handleTrpcError in web/src/utils/api.ts
- if (
- error &&
- typeof error === "object" &&
- "name" in error &&
- error.name === "TRPCClientError"
- ) {
- return null;
- }
-
- // Filter HTTP client errors from tRPC endpoints
- // These are captured at the network level by httpClientIntegration but are already
- // handled by tRPC's error handling system
- if (
- (event.exception?.values?.[0]?.mechanism?.type === "http.client" ||
- event.exception?.values?.[0]?.mechanism?.type ===
- "auto.http.client.fetch") &&
- event.request?.url?.includes("/api/trpc/")
- ) {
- return null;
- }
-
// Filter invalid href errors - these are from user-inputted data containing malformed URLs
// The Next.js router correctly rejects them, no need to log as errors
if (
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index a2d54cb262..8080308973 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -120,10 +120,8 @@ const handleTrpcError = (
return;
}
}
- // Only send server errors (5xx) to Sentry, not client errors (4xx)
- if (httpStatus >= 500 && httpStatus < 600) {
- captureException(error);
- }
+
+ captureException(error);
} else {
// For non-TRPC errors, still send to Sentry
captureException(error);