From 82ba62e80da8a5947124e012a19cfa0f50cbe87d Mon Sep 17 00:00:00 2001 From: vmarchaud Date: Wed, 15 Apr 2020 10:46:02 +0200 Subject: [PATCH] chore: remove use of NoopSpan --- packages/opentelemetry-plugin-http/src/http.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/opentelemetry-plugin-http/src/http.ts b/packages/opentelemetry-plugin-http/src/http.ts index ee9bb05df0e..fa5d1fea2b4 100644 --- a/packages/opentelemetry-plugin-http/src/http.ts +++ b/packages/opentelemetry-plugin-http/src/http.ts @@ -24,7 +24,6 @@ import { Status, SpanContext, TraceFlags, - NoopSpan, } from '@opentelemetry/api'; import { BasePlugin, @@ -308,7 +307,7 @@ export class HttpPlugin extends BasePlugin { }; return context.with(propagation.extract(headers), () => { - let span: Span = new NoopSpan(); + let span: Span; const hasParent = plugin._tracer.getCurrentSpan() !== undefined; /* * If a parent is required but not present, we use a `NoRecordingSpan` to still @@ -423,7 +422,7 @@ export class HttpPlugin extends BasePlugin { kind: SpanKind.CLIENT, }; const hasParent = plugin._tracer.getCurrentSpan() !== undefined; - let span: Span = new NoopSpan(); + let span: Span; /* * If a parent is required but not present, we use a `NoRecordingSpan` to still * propagate context without recording it.