Add query to span as a tag.

This commit is contained in:
Sam Rose 2024-07-31 15:40:54 +01:00
parent e62298e199
commit f0dbaa5eae
No known key found for this signature in database
1 changed files with 4 additions and 4 deletions

View File

@ -227,10 +227,10 @@ async function runSqlQuery(
const db = context.getAppDB()
return await tracer.trace(
"sqs.runSqlQuery",
async () => await db.sql<Row>(sql, bindings)
)
return await tracer.trace("sqs.runSqlQuery", async span => {
span?.addTags({ sql })
return await db.sql<Row>(sql, bindings)
})
}
const response = await alias.queryWithAliasing(json, processSQLQuery)
if (opts?.countTotalRows) {