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 21, 2024
1 parent c597b74 commit 4d7b0aa
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 @@ -1687,7 +1687,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 @@ -473,7 +473,7 @@ describe('EndToEnd', () => {
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 @@ -3395,7 +3395,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 4d7b0aa

Please sign in to comment.