all repos — homestead @ a20285a974409ffdf96d6d66454e5c90b08a2999

Code for my website

Remove Sentry tracing (keep error logging)

Alan Pearce
commit

a20285a974409ffdf96d6d66454e5c90b08a2999

parent

d7047a331b30cbde18f5c70754238fa2a2600c61

1 file changed, 0 insertions(+), 23 deletions(-)

jump to
M src/app.tssrc/app.ts
@@ -154,17 +154,6 @@ const hostname = request.headers.get("host")?.toLowerCase() || "unknown";
const endTimer = metrics.requestDuration.startTimer({ path: pathname }); let status; let newpath; - const transaction = Sentry.startTransaction({ - name: pathname, - op: "http.server", - description: `${request.method} ${pathname}`, - tags: { - url: request.url, - "http.host": hostname, - "http.method": request.method, - "http.user_agent": request.headers.get("user-agent"), - }, - }); try { if (pathname === "/health") { return new Response("OK", { status: (status = 200) });
@@ -204,7 +193,6 @@ path: pathname,
status_code: (status = 304), cache_basis: etagMatch ? "etag" : "mtime", }); - transaction.setHttpStatus(304); return new Response("", { status: status, headers: defaultHeaders }); } const encodings = (request.headers.get("accept-encoding") || "")
@@ -222,7 +210,6 @@ suffix = ".gz";
} status = 200; - transaction.setHttpStatus(status); metrics.requests.inc({ method: request.method, hostname,
@@ -268,14 +255,6 @@ status: status,
headers: { location: newpath }, }); } - metrics.requests.inc({ - method: request.method, - hostname, - path: pathname, - status_code: (status = 404), - content_encoding: contentEncoding, - }); - transaction.setHttpStatus(status); const notfound = files.get("/404.html"); if (notfound) { return serveFile(notfound, status, {
@@ -290,7 +269,6 @@ });
} } } catch (error) { - transaction.setHttpStatus((status = 503)); metrics.requests.inc({ method: request.method, hostname,
@@ -306,7 +284,6 @@ if (status === 200) {
const seconds = endTimer(); metrics.requestDuration.observe(seconds); } - transaction.finish(); log.info( request.method, status,