From cf39f4b37c0a5bf4734a7942ffdf7549f019f847 Mon Sep 17 00:00:00 2001 From: timgl Date: Wed, 9 Oct 2024 21:44:52 +0100 Subject: [PATCH] fix: Add queryId to query failed event (#25476) --- frontend/src/queries/query.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/queries/query.ts b/frontend/src/queries/query.ts index 5a39c0902e9e5..1ea01c13868f1 100644 --- a/frontend/src/queries/query.ts +++ b/frontend/src/queries/query.ts @@ -147,10 +147,20 @@ export async function performQuery( logParams.clickhouse_sql = (response as HogQLQueryResponse)?.clickhouse } } - posthog.capture('query completed', { query: queryNode, duration: performance.now() - startTime, ...logParams }) + posthog.capture('query completed', { + query: queryNode, + queryId, + duration: performance.now() - startTime, + ...logParams, + }) return response } catch (e) { - posthog.capture('query failed', { query: queryNode, duration: performance.now() - startTime, ...logParams }) + posthog.capture('query failed', { + query: queryNode, + queryId, + duration: performance.now() - startTime, + ...logParams, + }) throw e } }