Skip to content

Commit

Permalink
fix: Add queryId to query failed event (#25476)
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl authored Oct 9, 2024
1 parent 85f9317 commit cf39f4b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions frontend/src/queries/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,20 @@ export async function performQuery<N extends DataNode>(
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
}
}
Expand Down

0 comments on commit cf39f4b

Please sign in to comment.