From 74f5832a8a423bea62ee55fd4c6dfd97d4ef27a3 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 17 Nov 2023 09:31:06 +0000 Subject: [PATCH] add cache status to all requests --- apps/proxy/src/routes/proxy.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/proxy/src/routes/proxy.ts b/apps/proxy/src/routes/proxy.ts index f25d9d1..4c64415 100644 --- a/apps/proxy/src/routes/proxy.ts +++ b/apps/proxy/src/routes/proxy.ts @@ -84,14 +84,12 @@ async function logRequestToDatabase({ const point = new Point("proxy") .tag("type", "request") .tag("node", nodeId) + .tag("cached", cached ? "true" : "false") .stringField("url", url) .intField("status", status) .timestamp(Date.now()); - if (cached) { - point.tag("cached", "true"); - } if (time) { - point.intField("time", time as number); + point.intField("time", time); } try { InfluxWriteApi.writePoint(point);