Skip to content

Commit 918ea3d

Browse files
chore: update pg instr
1 parent e3ae6b6 commit 918ea3d

File tree

1 file changed

+4
-1
lines changed
  • packages/core/src/tracing/instrumentation/databases

1 file changed

+4
-1
lines changed

packages/core/src/tracing/instrumentation/databases/pgNative.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ function startSpanBeforeSync(ctx, originalFn, originalArgs, statement, stackTrac
197197
function finishSpan(error, span) {
198198
if (error) {
199199
span.ec = 1;
200-
tracingUtil.setErrorStack(span, error, exports.spanName);
200+
// Note: Instead of 'pg', we could've passed exports.spanName if they were the same,
201+
// We can’t use spanName here because for this instr the span name is
202+
// "postgres", but the data is stored under span.data.pg.
203+
tracingUtil.setErrorStack(span, error, 'pg');
201204
}
202205

203206
span.d = Date.now() - span.ts;

0 commit comments

Comments
 (0)