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

Commit

Permalink
chore: reuse NoopTracer in ProxyTracer (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flarna committed Jul 24, 2021
1 parent 14655bc commit 1fa6248
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/trace/ProxyTracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { Span } from './span';
import { SpanOptions } from './SpanOptions';
import { Tracer } from './tracer';

const NOOP_TRACER = new NoopTracer();

/**
* Proxy tracer provided by the proxy tracer provider
*/
Expand Down Expand Up @@ -60,7 +62,7 @@ export class ProxyTracer implements Tracer {
const tracer = this._provider.getDelegateTracer(this.name, this.version);

if (!tracer) {
return new NoopTracer();
return NOOP_TRACER;
}

this._delegate = tracer;
Expand Down

0 comments on commit 1fa6248

Please sign in to comment.