Skip to content

Commit f0b8745

Browse files
committed
Uncommitted change for Database.getSnapshot: end span before sending back response
1 parent 0458064 commit f0b8745

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

observability-test/spanner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ describe('EndToEnd', async () => {
235235

236236
const expectedSpanNames = [
237237
'CloudSpanner.Snapshot.begin',
238+
'CloudSpanner.Database.getSnapshot',
238239
'CloudSpanner.Snapshot.runStream',
239240
'CloudSpanner.Snapshot.run',
240-
'CloudSpanner.Database.getSnapshot',
241241
];
242242
assert.deepStrictEqual(
243243
actualSpanNames,
@@ -248,10 +248,10 @@ describe('EndToEnd', async () => {
248248
const expectedEventNames = [
249249
'Begin Transaction',
250250
'Transaction Creation Done',
251-
'Starting stream',
252251
'Acquiring session',
253252
'Cache hit: has usable session',
254253
'Acquired session',
254+
'Starting stream',
255255
];
256256
assert.deepStrictEqual(
257257
actualEventNames,

src/database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,7 @@ class Database extends common.GrpcServiceObject {
21142114
}
21152115

21162116
this._releaseOnEnd(session!, snapshot, span);
2117+
span.end();
21172118
callback!(err, snapshot);
21182119
});
21192120
});

0 commit comments

Comments
 (0)