Skip to content

Commit

Permalink
Merge pull request #14291 from Budibase/record-sqs-queries-in-datadog
Browse files Browse the repository at this point in the history
Record SQS queries in DataDog.
  • Loading branch information
samwho authored Jul 31, 2024
2 parents a646fc5 + f0dbaa5 commit ff6d220
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/server/src/sdk/app/rows/search/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
} from "./filters"
import { dataFilters, PROTECTED_INTERNAL_COLUMNS } from "@budibase/shared-core"
import { isSearchingByRowID } from "./utils"
import tracer from "dd-trace"

const builder = new sql.Sql(SqlClient.SQL_LITE)
const MISSING_COLUMN_REGEX = new RegExp(`no such column: .+`)
Expand Down Expand Up @@ -225,7 +226,11 @@ async function runSqlQuery(
}

const db = context.getAppDB()
return 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) {
Expand Down

0 comments on commit ff6d220

Please sign in to comment.