Skip to content

Commit

Permalink
feat: (observability): trace Database.runTransactionAsync
Browse files Browse the repository at this point in the history
Extracted out of PR googleapis#2158, this change traces
Database.runTransactionAsync.

Updates googleapis#2079
  • Loading branch information
odeke-em authored and surbhigarg92 committed Oct 25, 2024
1 parent bd4647c commit f6fa667
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion observability-test/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ describe('Database', () => {
'Unexpected span status message'
);

const expectedEventNames = ['Using Session', 'exception'];
const expectedEventNames = ['Using Session'];
assert.deepStrictEqual(
actualEventNames,
expectedEventNames,
Expand Down
2 changes: 1 addition & 1 deletion observability-test/spanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ describe('EndToEnd', async () => {
database.formattedName_
);
await database.runTransactionAsync(async transaction => {
await transaction!.run('SELECT 1');
const [rows] = await transaction!.run('SELECT 1');
});

traceExporter.forceFlush();
Expand Down
2 changes: 1 addition & 1 deletion src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3385,7 +3385,7 @@ class Database extends common.GrpcServiceObject {
try {
return await runner.run();
} catch (e) {
setSpanErrorAndException(span, e as Error);
setSpanError(span, e as Error);
throw e;
} finally {
span.end();
Expand Down

0 comments on commit f6fa667

Please sign in to comment.