-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node - express
SDK Version
10.29.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
@sentry/node >= 10.29.0 when using postgres and drizzle-orm results in DB query latency increases. Increase at ~1pm reflects this. Below charts show duration of spans that wrap drizzle queries.
I've tested with every version >= 10.29.0, none of which resolve this issue. 10.28.0 is fine. Also it seems that the versions with errors seem to break some postgres instrumentation? (below images are directly from db spans)
Any ideas what the issue might be? For some context: we're computing the first image's charts spans like this:
export const withServerTrace = async <T>(
{ name, op = 'service', attributes }: ServerSpanArgs,
fn: (span: Sentry.Span) => Promise<T> | T
): Promise<T> => {
return Sentry.startSpan({ name, op, attributes }, async (span) => {
try {
return await fn(span)
} catch (err) {
span.setStatus({ code: 2, message: 'internal_error' })
Sentry.captureException(err)
throw err
}
})
}And here's an example usage with drizzle-orm:
export const getChat = async ({ chatId }: { chatId: string }) => {
return await withServerTrace(
{ name: 'getChat', op: 'api.query' },
async () => {
return await db.query.chats.findFirst({
where: (chats, { eq }) => eq(chats.id, chatId),
})
}
)
}Expected Result
No DB query latency increases.
Actual Result
DB query latency increasing.
Additional Context
No response
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status