From a926b530d3c9dd12472b918c620d8bce84e96834 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 11 Apr 2024 21:05:29 +0200 Subject: Remove Sentry tracing (keep error logging) --- src/app.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/app.ts b/src/app.ts index d3a676f..934df05 100644 --- a/src/app.ts +++ b/src/app.ts @@ -154,17 +154,6 @@ export const server = { 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 @@ export const server = { 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 @@ export const server = { } status = 200; - transaction.setHttpStatus(status); metrics.requests.inc({ method: request.method, hostname, @@ -268,14 +255,6 @@ export const server = { 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 @@ export const server = { } } } catch (error) { - transaction.setHttpStatus((status = 503)); metrics.requests.inc({ method: request.method, hostname, @@ -306,7 +284,6 @@ export const server = { const seconds = endTimer(); metrics.requestDuration.observe(seconds); } - transaction.finish(); log.info( request.method, status, -- cgit 1.4.1