mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
chore: Remove Koa middleware span reporting (#12501)
This commit is contained in:
@@ -31,6 +31,10 @@ if (env.DD_API_KEY) {
|
||||
env: env.ENVIRONMENT,
|
||||
logInjection: true,
|
||||
});
|
||||
|
||||
// Disable per-middleware spans so that non-reportable errors are not captured
|
||||
// This is also generally excessive noise
|
||||
tracer.use("koa", { middleware: false });
|
||||
}
|
||||
|
||||
const getCurrentSpan = (): Span | null => tracer.scope().active();
|
||||
|
||||
@@ -7,7 +7,6 @@ import { escape, isNil, snakeCase } from "es-toolkit/compat";
|
||||
import env from "@server/env";
|
||||
import { ClientClosedRequestError, InternalError } from "@server/errors";
|
||||
import { requestErrorHandler } from "@server/logging/sentry";
|
||||
import { addTags, getRootSpanFromRequestContext } from "@server/logging/tracer";
|
||||
|
||||
let errorHtmlCache: Buffer | undefined;
|
||||
|
||||
@@ -54,14 +53,6 @@ export default function onerror(app: Koa) {
|
||||
}
|
||||
err = InternalError();
|
||||
}
|
||||
} else {
|
||||
// Clear error tags that dd-trace's Koa plugin sets automatically
|
||||
// when an exception propagates through middleware, so that
|
||||
// non-reportable errors are not flagged as errors in DataDog.
|
||||
const span = getRootSpanFromRequestContext(this);
|
||||
if (span) {
|
||||
addTags({ error: false }, span);
|
||||
}
|
||||
}
|
||||
|
||||
const headerSent = this.headerSent || !this.writable;
|
||||
|
||||
Reference in New Issue
Block a user