Skip to content

Commit

Permalink
incorporate HttpTextFormat interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Jul 16, 2019
1 parent 7754528 commit 034584d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
* limitations under the License.
*/

import { Propagator, SpanContext } from '@opentelemetry/types';
import { HttpTextFormat, SpanContext } from '@opentelemetry/types';

/**
* No-op implementations of {@link Propagator}.
*
* @todo: Change Propagator to HttpTextFormat based on https://github.com/open-telemetry/opentelemetry-js/pull/70
* No-op implementations of {@link HttpTextFormat}.
*/
class NoopHttpTextFormat implements Propagator {
class NoopHttpTextFormat implements HttpTextFormat {
// By default does nothing
inject(spanContext: SpanContext, format: string, carrier: unknown): void {}
// By default does nothing
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry-core/src/trace/NoopTracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Tracer,
SpanOptions,
Span,
Propagator,
HttpTextFormat,
BinaryFormat,
} from '@opentelemetry/types';
import { NOOP_HTTP_TEXT_FORMAT } from '../context/propagation/NoopHttpTextFormat';
Expand Down Expand Up @@ -57,9 +57,8 @@ export class NoopTracer implements Tracer {
return NOOP_BINARY_FORMAT;
}

// @todo: Use new interface https://github.com/open-telemetry/opentelemetry-js/pull/70
// By default does nothing
getHttpTextFormat(): Propagator {
getHttpTextFormat(): HttpTextFormat {
return NOOP_HTTP_TEXT_FORMAT;
}
}

0 comments on commit 034584d

Please sign in to comment.