Skip to content

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

chore: add query tags to health check queries (#6493)

Steffen Schmitz3e92e6b74df4
diff --git a/web/src/pages/api/public/health.ts b/web/src/pages/api/public/health.ts
index e01f6a9bdb..7e8f97fcb3 100644
--- a/web/src/pages/api/public/health.ts
+++ b/web/src/pages/api/public/health.ts
@@ -41,25 +41,33 @@ export default async function handler(
query: `
SELECT id
FROM traces
- WHERE created_at <= {now: DateTime64(3)}
- AND created_at >= {now: DateTime64(3)} - INTERVAL 3 MINUTE
+ WHERE timestamp <= {now: DateTime64(3)}
+ AND timestamp >= {now: DateTime64(3)} - INTERVAL 3 MINUTE
LIMIT 1
`,
params: {
now: convertDateToClickhouseDateTime(now),
},
+ tags: {
+ feature: "health-check",
+ type: "trace",
+ },
});
const observations = await queryClickhouse({
query: `
SELECT id
FROM observations
- WHERE created_at <= {now: DateTime64(3)}
- AND created_at >= {now: DateTime64(3)} - INTERVAL 3 MINUTE
+ WHERE start_time <= {now: DateTime64(3)}
+ AND start_time >= {now: DateTime64(3)} - INTERVAL 3 MINUTE
LIMIT 1
`,
params: {
now: convertDateToClickhouseDateTime(now),
},
+ tags: {
+ feature: "health-check",
+ type: "observation",
+ },
});
if (traces.length === 0 || observations.length === 0) {
return res.status(503).json({