Skip to content

Commit ef204bc

Browse files
committed
fixes for end
1 parent b82ef99 commit ef204bc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/core/src/tracing/trace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function startSpan<T>(context: TransactionContext, callback: (span: Span
9797
scope.setSpan(activeSpan);
9898

9999
function finishAndSetSpan(): void {
100-
activeSpan && activeSpan.finish();
100+
activeSpan && activeSpan.end();
101101
}
102102

103103
let maybePromiseResult: T;
@@ -157,7 +157,7 @@ export function startSpanManual<T>(
157157
scope.setSpan(activeSpan);
158158

159159
function finishAndSetSpan(): void {
160-
activeSpan && activeSpan.finish();
160+
activeSpan && activeSpan.end();
161161
}
162162

163163
let maybePromiseResult: T;

packages/core/test/lib/tracing/trace.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ describe('startInactiveSpan', () => {
231231
expect(span).toBeDefined();
232232
expect(span?.endTimestamp).toBeUndefined();
233233

234-
span?.finish();
234+
span?.end();
235235

236236
expect(span?.endTimestamp).toBeDefined();
237237
});
@@ -241,9 +241,10 @@ describe('startInactiveSpan', () => {
241241

242242
const span = startInactiveSpan({ name: 'GET users/[id]' });
243243

244+
expect(span).toBeDefined();
244245
expect(initialScope.getSpan()).toBeUndefined();
245246

246-
span?.finish();
247+
span?.end();
247248

248249
expect(initialScope.getSpan()).toBeUndefined();
249250
});

0 commit comments

Comments
 (0)