Skip to content

Commit

Permalink
chore: reuse NoopTracer in ProxyTracer (open-telemetry#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flarna authored Jul 24, 2021
1 parent 3170a0e commit e197219
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/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 e197219

Please sign in to comment.