Skip to content

Commit f6fa667

Browse files
odeke-emsurbhigarg92
authored andcommitted
feat: (observability): trace Database.runTransactionAsync
Extracted out of PR #2158, this change traces Database.runTransactionAsync. Updates #2079
1 parent bd4647c commit f6fa667

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

observability-test/database.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ describe('Database', () => {
16961696
'Unexpected span status message'
16971697
);
16981698

1699-
const expectedEventNames = ['Using Session', 'exception'];
1699+
const expectedEventNames = ['Using Session'];
17001700
assert.deepStrictEqual(
17011701
actualEventNames,
17021702
expectedEventNames,

observability-test/spanner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ describe('EndToEnd', async () => {
488488
database.formattedName_
489489
);
490490
await database.runTransactionAsync(async transaction => {
491-
await transaction!.run('SELECT 1');
491+
const [rows] = await transaction!.run('SELECT 1');
492492
});
493493

494494
traceExporter.forceFlush();

src/database.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3385,7 +3385,7 @@ class Database extends common.GrpcServiceObject {
33853385
try {
33863386
return await runner.run();
33873387
} catch (e) {
3388-
setSpanErrorAndException(span, e as Error);
3388+
setSpanError(span, e as Error);
33893389
throw e;
33903390
} finally {
33913391
span.end();

0 commit comments

Comments
 (0)