Skip to content

Commit

Permalink
chore: remove use of NoopSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Apr 15, 2020
1 parent 344d9c0 commit 82ba62e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/opentelemetry-plugin-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
Status,
SpanContext,
TraceFlags,
NoopSpan,
} from '@opentelemetry/api';
import {
BasePlugin,
Expand Down Expand Up @@ -308,7 +307,7 @@ export class HttpPlugin extends BasePlugin<Http> {
};

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
Expand Down Expand Up @@ -423,7 +422,7 @@ export class HttpPlugin extends BasePlugin<Http> {
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.
Expand Down

0 comments on commit 82ba62e

Please sign in to comment.