From f0dbaa5eae0867cd8c1f109b7b24a9588b33d021 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 31 Jul 2024 15:40:54 +0100 Subject: [PATCH] Add query to span as a tag. --- packages/server/src/sdk/app/rows/search/sqs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/sqs.ts b/packages/server/src/sdk/app/rows/search/sqs.ts index 5b743d18c6..8a61684020 100644 --- a/packages/server/src/sdk/app/rows/search/sqs.ts +++ b/packages/server/src/sdk/app/rows/search/sqs.ts @@ -227,10 +227,10 @@ async function runSqlQuery( const db = context.getAppDB() - return await tracer.trace( - "sqs.runSqlQuery", - async () => await db.sql(sql, bindings) - ) + return await tracer.trace("sqs.runSqlQuery", async span => { + span?.addTags({ sql }) + return await db.sql(sql, bindings) + }) } const response = await alias.queryWithAliasing(json, processSQLQuery) if (opts?.countTotalRows) {