Skip to content

Commit 4d7b0aa

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 c597b74 commit 4d7b0aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

observability-test/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ describe('Database', () => {
16871687
'Unexpected span status message'
16881688
);
16891689

1690-
const expectedEventNames = ['Using Session', 'exception'];
1690+
const expectedEventNames = ['Using Session'];
16911691
assert.deepStrictEqual(
16921692
actualEventNames,
16931693
expectedEventNames,

observability-test/spanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ describe('EndToEnd', () => {
473473
database.formattedName_
474474
);
475475
await database.runTransactionAsync(async transaction => {
476-
await transaction!.run('SELECT 1');
476+
const [rows] = await transaction!.run('SELECT 1');
477477
});
478478

479479
traceExporter.forceFlush();

src/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3395,7 +3395,7 @@ class Database extends common.GrpcServiceObject {
33953395
try {
33963396
return await runner.run();
33973397
} catch (e) {
3398-
setSpanErrorAndException(span, e as Error);
3398+
setSpanError(span, e as Error);
33993399
throw e;
34003400
} finally {
34013401
span.end();

0 commit comments

Comments
 (0)