Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
chore: make startActiveSpan required in the tracer interface
Browse files Browse the repository at this point in the history
Signed-off-by: naseemkullah <naseem@transit.app>
  • Loading branch information
naseemkullah committed May 12, 2021
1 parent b53dd2f commit 56f11e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/trace/ProxyTracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,9 @@ export class ProxyTracer implements Tracer {
return this._getTracer().startSpan(name, options, context);
}

startActiveSpan?<F extends (span: Span) => ReturnType<F>>():
| ReturnType<F>
| undefined {
startActiveSpan<F extends (span: Span) => ReturnType<F>>(): ReturnType<F> {
const tracer = this._getTracer();

if (tracer.startActiveSpan) {
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
}
return;
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/trace/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ export interface Tracer {
* do some more work
* span.end();
*/
startActiveSpan?<F extends (span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
fn: F
): ReturnType<F>;
startActiveSpan?<F extends (span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SpanOptions,
fn: F
): ReturnType<F>;
startActiveSpan?<F extends (span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SpanOptions,
context: Context,
Expand Down

0 comments on commit 56f11e2

Please sign in to comment.