From a34d03a8f1157d599aa95f909f51ee7b014affef Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Thu, 27 Feb 2020 06:56:31 -0800 Subject: [PATCH] chore: remove binary propagator (#804) * chore: remove binary format Co-authored-by: Daniel Dyla --- .../src/context/propagation/BinaryFormat.ts | 36 ----- .../src/context/propagation/HttpTextFormat.ts | 26 ++-- .../context/propagation/NoopBinaryFormat.ts | 36 ----- packages/opentelemetry-api/src/index.ts | 1 - .../opentelemetry-api/src/trace/NoopTracer.ts | 8 +- .../opentelemetry-api/src/trace/tracer.ts | 14 -- .../opentelemetry-api/test/api/api.test.ts | 1 - .../noop-implementations/noop-tracer.test.ts | 6 - .../context/propagation/BinaryTraceContext.ts | 113 -------------- packages/opentelemetry-core/src/index.ts | 1 - .../test/context/BinaryTraceContext.test.ts | 144 ------------------ .../test/NodeTracerProvider.test.ts | 18 --- packages/opentelemetry-tracing/src/Tracer.ts | 9 -- packages/opentelemetry-tracing/src/config.ts | 2 - packages/opentelemetry-tracing/src/types.ts | 6 - .../test/BasicTracerRegistry.test.ts | 15 -- 16 files changed, 17 insertions(+), 419 deletions(-) delete mode 100644 packages/opentelemetry-api/src/context/propagation/BinaryFormat.ts delete mode 100644 packages/opentelemetry-api/src/context/propagation/NoopBinaryFormat.ts delete mode 100644 packages/opentelemetry-core/src/context/propagation/BinaryTraceContext.ts delete mode 100644 packages/opentelemetry-core/test/context/BinaryTraceContext.test.ts diff --git a/packages/opentelemetry-api/src/context/propagation/BinaryFormat.ts b/packages/opentelemetry-api/src/context/propagation/BinaryFormat.ts deleted file mode 100644 index 3ca33f309de..00000000000 --- a/packages/opentelemetry-api/src/context/propagation/BinaryFormat.ts +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { SpanContext } from '../../trace/span_context'; - -/** - * Formatter to serializing and deserializing a value with into a binary format. - */ -export interface BinaryFormat { - /** - * Serialize the given span context into a Buffer. - * @param spanContext The span context to serialize. - */ - toBytes(spanContext: SpanContext): ArrayBuffer; - - /** - * Deseralize the given span context from binary encoding. If the input is a - * Buffer of incorrect size or unexpected fields, then this function will - * return `null`. - * @param buffer The span context to deserialize. - */ - fromBytes(buffer: ArrayBuffer): SpanContext | null; -} diff --git a/packages/opentelemetry-api/src/context/propagation/HttpTextFormat.ts b/packages/opentelemetry-api/src/context/propagation/HttpTextFormat.ts index fef9293ecf9..6e14f948681 100644 --- a/packages/opentelemetry-api/src/context/propagation/HttpTextFormat.ts +++ b/packages/opentelemetry-api/src/context/propagation/HttpTextFormat.ts @@ -19,8 +19,9 @@ import { Carrier } from './carrier'; /** * Injects {@link Context} into and extracts it from carriers that travel - * in-band across process boundaries. Encoding is expected to conform to the HTTP - * Header Field semantics. Values are often encoded as RPC/HTTP request headers. + * in-band across process boundaries. Encoding is expected to conform to the + * HTTP Header Field semantics. Values are often encoded as RPC/HTTP request + * headers. * * The carrier of propagated data on both the client (injector) and server * (extractor) side is usually an object such as http headers. @@ -29,20 +30,25 @@ export interface HttpTextFormat { /** * Injects values from a given {@link Context} into a carrier. * - * OpenTelemetry defines a common set of format values (BinaryFormat and - * HTTPTextFormat), and each has an expected `carrier` type. + * OpenTelemetry defines a common set of format values (HTTPTextFormat), and + * each has an expected `carrier` type. * - * @param context the Context from which to extract values to transmit over the wire. - * @param carrier the carrier of propagation fields, such as http request headers. + * @param context the Context from which to extract values to transmit over + * the wire. + * @param carrier the carrier of propagation fields, such as http request + * headers. */ inject(context: Context, carrier: Carrier): void; /** - * Given a {@link Context} and a carrier, extract context values from a carrier and - * return a new context, created from the old context, with the extracted values. + * Given a {@link Context} and a carrier, extract context values from a + * carrier and return a new context, created from the old context, with the + * extracted values. * - * @param context the Context from which to extract values to transmit over the wire. - * @param carrier the carrier of propagation fields, such as http request headers. + * @param context the Context from which to extract values to transmit over + * the wire. + * @param carrier the carrier of propagation fields, such as http request + * headers. */ extract(context: Context, carrier: Carrier): Context; } diff --git a/packages/opentelemetry-api/src/context/propagation/NoopBinaryFormat.ts b/packages/opentelemetry-api/src/context/propagation/NoopBinaryFormat.ts deleted file mode 100644 index effec6183fc..00000000000 --- a/packages/opentelemetry-api/src/context/propagation/NoopBinaryFormat.ts +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { SpanContext } from '../../trace/span_context'; -import { BinaryFormat } from './BinaryFormat'; - -/** - * No-op implementations of {@link BinaryFormat}. - */ -export class NoopBinaryFormat implements BinaryFormat { - private readonly _buff = new ArrayBuffer(0); - // By default does nothing - toBytes(spanContext: SpanContext): ArrayBuffer { - return this._buff; - } - - // By default does nothing - fromBytes(buf: ArrayBuffer): SpanContext | null { - return null; - } -} - -export const NOOP_BINARY_FORMAT = new NoopBinaryFormat(); diff --git a/packages/opentelemetry-api/src/index.ts b/packages/opentelemetry-api/src/index.ts index 3b4e33c1462..581fec31be2 100644 --- a/packages/opentelemetry-api/src/index.ts +++ b/packages/opentelemetry-api/src/index.ts @@ -16,7 +16,6 @@ export * from './common/Logger'; export * from './common/Time'; -export * from './context/propagation/BinaryFormat'; export * from './context/propagation/carrier'; export * from './context/propagation/HttpTextFormat'; export * from './distributed_context/DistributedContext'; diff --git a/packages/opentelemetry-api/src/trace/NoopTracer.ts b/packages/opentelemetry-api/src/trace/NoopTracer.ts index 27e47a9093c..b1928ee8898 100644 --- a/packages/opentelemetry-api/src/trace/NoopTracer.ts +++ b/packages/opentelemetry-api/src/trace/NoopTracer.ts @@ -14,8 +14,7 @@ * limitations under the License. */ -import { BinaryFormat, HttpTextFormat, Span, SpanOptions, Tracer } from '..'; -import { NOOP_BINARY_FORMAT } from '../context/propagation/NoopBinaryFormat'; +import { HttpTextFormat, Span, SpanOptions, Tracer } from '..'; import { NOOP_HTTP_TEXT_FORMAT } from '../context/propagation/NoopHttpTextFormat'; import { NOOP_SPAN } from './NoopSpan'; @@ -43,11 +42,6 @@ export class NoopTracer implements Tracer { return target; } - // By default does nothing - getBinaryFormat(): BinaryFormat { - return NOOP_BINARY_FORMAT; - } - // By default does nothing getHttpTextFormat(): HttpTextFormat { return NOOP_HTTP_TEXT_FORMAT; diff --git a/packages/opentelemetry-api/src/trace/tracer.ts b/packages/opentelemetry-api/src/trace/tracer.ts index 6d17cbc5a18..a959e11c4aa 100644 --- a/packages/opentelemetry-api/src/trace/tracer.ts +++ b/packages/opentelemetry-api/src/trace/tracer.ts @@ -15,7 +15,6 @@ */ import { HttpTextFormat } from '../context/propagation/HttpTextFormat'; -import { BinaryFormat } from '../context/propagation/BinaryFormat'; import { Span } from './span'; import { SpanOptions } from './SpanOptions'; @@ -65,19 +64,6 @@ export interface Tracer { */ bind(target: T, span?: Span): T; - /** - * Returns the {@link BinaryFormat} interface which can serialize/deserialize - * Spans. - * - * If no tracer implementation is provided, this defaults to the W3C Trace - * Context binary format {@link BinaryFormat}. For more details see - * W3C Trace Context - * binary protocol. - * - * @returns the {@link BinaryFormat} for this implementation. - */ - getBinaryFormat(): BinaryFormat; - /** * Returns the {@link HttpTextFormat} interface which can inject/extract * Spans. diff --git a/packages/opentelemetry-api/test/api/api.test.ts b/packages/opentelemetry-api/test/api/api.test.ts index cfc75dfe365..82114d16944 100644 --- a/packages/opentelemetry-api/test/api/api.test.ts +++ b/packages/opentelemetry-api/test/api/api.test.ts @@ -29,7 +29,6 @@ describe('API', () => { 'getCurrentSpan', 'startSpan', 'withSpan', - 'getBinaryFormat', 'getHttpTextFormat', ]; diff --git a/packages/opentelemetry-api/test/noop-implementations/noop-tracer.test.ts b/packages/opentelemetry-api/test/noop-implementations/noop-tracer.test.ts index ed017dda998..8fd67c145df 100644 --- a/packages/opentelemetry-api/test/noop-implementations/noop-tracer.test.ts +++ b/packages/opentelemetry-api/test/noop-implementations/noop-tracer.test.ts @@ -20,7 +20,6 @@ import { Context } from '@opentelemetry/scope-base'; describe('NoopTracer', () => { it('should not crash', () => { - const spanContext = { traceId: '', spanId: '' }; const tracer = new NoopTracer(); assert.deepStrictEqual(tracer.startSpan('span-name'), NOOP_SPAN); @@ -45,11 +44,6 @@ describe('NoopTracer', () => { httpTextFormat.extract(Context.ROOT_CONTEXT, {}), Context.ROOT_CONTEXT ); - - const binaryFormat = tracer.getBinaryFormat(); - assert.ok(binaryFormat); - assert.ok(binaryFormat.toBytes(spanContext), typeof ArrayBuffer); - assert.deepStrictEqual(binaryFormat.fromBytes(new ArrayBuffer(0)), null); }); it('should not crash when .withSpan()', done => { diff --git a/packages/opentelemetry-core/src/context/propagation/BinaryTraceContext.ts b/packages/opentelemetry-core/src/context/propagation/BinaryTraceContext.ts deleted file mode 100644 index ebcd0391cd2..00000000000 --- a/packages/opentelemetry-core/src/context/propagation/BinaryTraceContext.ts +++ /dev/null @@ -1,113 +0,0 @@ -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { BinaryFormat, SpanContext, TraceFlags } from '@opentelemetry/api'; - -const VERSION_ID = 0; -const TRACE_ID_FIELD_ID = 0; -const SPAN_ID_FIELD_ID = 1; -const TRACE_OPTION_FIELD_ID = 2; - -// Sizes are number of bytes. -const ID_SIZE = 1; -const TRACE_ID_SIZE = 16; -const SPAN_ID_SIZE = 8; -const TRACE_OPTION_SIZE = 1; - -const VERSION_ID_OFFSET = 0; -const TRACE_ID_FIELD_ID_OFFSET = VERSION_ID_OFFSET + ID_SIZE; -const TRACE_ID_OFFSET = TRACE_ID_FIELD_ID_OFFSET + ID_SIZE; -const SPAN_ID_FIELD_ID_OFFSET = TRACE_ID_OFFSET + TRACE_ID_SIZE; -const SPAN_ID_OFFSET = SPAN_ID_FIELD_ID_OFFSET + ID_SIZE; -const TRACE_OPTION_FIELD_ID_OFFSET = SPAN_ID_OFFSET + SPAN_ID_SIZE; -const TRACE_OPTIONS_OFFSET = TRACE_OPTION_FIELD_ID_OFFSET + ID_SIZE; - -const FORMAT_LENGTH = - 4 * ID_SIZE + TRACE_ID_SIZE + SPAN_ID_SIZE + TRACE_OPTION_SIZE; - -export class BinaryTraceContext implements BinaryFormat { - toBytes(spanContext: SpanContext): Uint8Array { - /** - * 0 1 2 - * 0 1 2345678901234567 8 90123456 7 8 - * ------------------------------------- - * | | | | | | | | - * ------------------------------------- - * ^ ^ ^ ^ ^ ^ ^ - * | | | | | | `-- options value - * | | | | | `---- options field ID (2) - * | | | | `---------- spanID value - * | | | `--------------- spanID field ID (1) - * | | `--------------------------- traceID value - * | `---------------------------------- traceID field ID (0) - * `------------------------------------ version (0) - */ - const traceId = spanContext.traceId; - const spanId = spanContext.spanId; - const buf = new Uint8Array(FORMAT_LENGTH); - let j = TRACE_ID_OFFSET; - for (let i = TRACE_ID_OFFSET; i < SPAN_ID_FIELD_ID_OFFSET; i++) { - // tslint:disable-next-line:ban Needed to parse hexadecimal. - buf[j++] = parseInt(traceId.substr((i - TRACE_ID_OFFSET) * 2, 2), 16); - } - buf[j++] = SPAN_ID_FIELD_ID; - for (let i = SPAN_ID_OFFSET; i < TRACE_OPTION_FIELD_ID_OFFSET; i++) { - // tslint:disable-next-line:ban Needed to parse hexadecimal. - buf[j++] = parseInt(spanId.substr((i - SPAN_ID_OFFSET) * 2, 2), 16); - } - buf[j++] = TRACE_OPTION_FIELD_ID; - buf[j++] = Number(spanContext.traceFlags) || TraceFlags.UNSAMPLED; - return buf; - } - - fromBytes(buf: Uint8Array): SpanContext | null { - const result: SpanContext = { traceId: '', spanId: '' }; - // Length must be 29. - if (buf.length !== FORMAT_LENGTH) return null; - // Check version and field numbers. - if ( - buf[VERSION_ID_OFFSET] !== VERSION_ID || - buf[TRACE_ID_FIELD_ID_OFFSET] !== TRACE_ID_FIELD_ID || - buf[SPAN_ID_FIELD_ID_OFFSET] !== SPAN_ID_FIELD_ID || - buf[TRACE_OPTION_FIELD_ID_OFFSET] !== TRACE_OPTION_FIELD_ID - ) { - return null; - } - - result.isRemote = true; - - // See serializeSpanContext for byte offsets. - result.traceId = toHex(buf.slice(TRACE_ID_OFFSET, SPAN_ID_FIELD_ID_OFFSET)); - result.spanId = toHex( - buf.slice(SPAN_ID_OFFSET, TRACE_OPTION_FIELD_ID_OFFSET) - ); - result.traceFlags = buf[TRACE_OPTIONS_OFFSET]; - return result; - } -} - -function toHex(buff: Uint8Array) { - let out = ''; - for (let i = 0; i < buff.length; ++i) { - const n = buff[i]; - if (n < 16) { - out += '0' + n.toString(16); - } else { - out += n.toString(16); - } - } - return out; -} diff --git a/packages/opentelemetry-core/src/index.ts b/packages/opentelemetry-core/src/index.ts index 3038ce0b956..61168c30bcb 100644 --- a/packages/opentelemetry-core/src/index.ts +++ b/packages/opentelemetry-core/src/index.ts @@ -21,7 +21,6 @@ export * from './common/types'; export * from './version'; export * from './context/context'; export * from './context/propagation/B3Format'; -export * from './context/propagation/BinaryTraceContext'; export * from './context/propagation/HttpTraceContext'; export * from './platform'; export * from './trace/instrumentation/BasePlugin'; diff --git a/packages/opentelemetry-core/test/context/BinaryTraceContext.test.ts b/packages/opentelemetry-core/test/context/BinaryTraceContext.test.ts deleted file mode 100644 index 0b5c303fd46..00000000000 --- a/packages/opentelemetry-core/test/context/BinaryTraceContext.test.ts +++ /dev/null @@ -1,144 +0,0 @@ -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as assert from 'assert'; -import { BinaryTraceContext } from '../../src/context/propagation/BinaryTraceContext'; -import { SpanContext, TraceFlags } from '@opentelemetry/api'; - -describe('BinaryTraceContext', () => { - const binaryTraceContext = new BinaryTraceContext(); - const commonTraceId = 'd4cda95b652f4a1592b449d5929fda1b'; - const commonSpanId = '75e8ed491aec7eca'; - - const testCases: Array<{ - structured: SpanContext | null; - binary: Uint8Array; - description: string; - }> = [ - { - structured: { - traceId: commonTraceId, - spanId: commonSpanId, - traceFlags: TraceFlags.SAMPLED, - }, - binary: new Uint8Array([ - 0, - 0, - 212, - 205, - 169, - 91, - 101, - 47, - 74, - 21, - 146, - 180, - 73, - 213, - 146, - 159, - 218, - 27, - 1, - 117, - 232, - 237, - 73, - 26, - 236, - 126, - 202, - 2, - 1, - ]), - description: 'span context with 64-bit span ID', - }, - { - structured: { traceId: commonTraceId, spanId: commonSpanId }, - binary: new Uint8Array([ - 0, - 0, - 212, - 205, - 169, - 91, - 101, - 47, - 74, - 21, - 146, - 180, - 73, - 213, - 146, - 159, - 218, - 27, - 1, - 117, - 232, - 237, - 73, - 26, - 236, - 126, - 202, - 2, - 0, - ]), - description: 'span context with no traceFlags', - }, - { - structured: null, - binary: new Uint8Array([0, 0]), - description: 'incomplete binary span context (by returning null)', - }, - { - structured: null, - binary: new Uint8Array(58), - description: 'bad binary span context (by returning null)', - }, - ]; - - describe('.toBytes()', () => { - testCases.forEach( - testCase => - testCase.structured && - it(`should serialize ${testCase.description}`, () => { - assert.deepStrictEqual( - binaryTraceContext.toBytes(testCase.structured!), - testCase.binary - ); - }) - ); - }); - - describe('.fromBytes()', () => { - testCases.forEach(testCase => - it(`should deserialize ${testCase.description}`, () => { - assert.deepStrictEqual( - binaryTraceContext.fromBytes(testCase.binary), - testCase.structured && - Object.assign( - { isRemote: true, traceFlags: TraceFlags.UNSAMPLED }, - testCase.structured - ) - ); - }) - ); - }); -}); diff --git a/packages/opentelemetry-node/test/NodeTracerProvider.test.ts b/packages/opentelemetry-node/test/NodeTracerProvider.test.ts index 38ba91ff920..21fc5919c16 100644 --- a/packages/opentelemetry-node/test/NodeTracerProvider.test.ts +++ b/packages/opentelemetry-node/test/NodeTracerProvider.test.ts @@ -17,7 +17,6 @@ import * as assert from 'assert'; import { ALWAYS_SAMPLER, - BinaryTraceContext, HttpTraceContext, NEVER_SAMPLER, NoopLogger, @@ -57,13 +56,6 @@ describe('NodeTracerProvider', () => { assert.ok(provider instanceof NodeTracerProvider); }); - it('should construct an instance with binary format', () => { - provider = new NodeTracerProvider({ - binaryFormat: new BinaryTraceContext(), - }); - assert.ok(provider instanceof NodeTracerProvider); - }); - it('should construct an instance with http text format', () => { provider = new NodeTracerProvider({ httpTextFormat: new HttpTraceContext(), @@ -262,16 +254,6 @@ describe('NodeTracerProvider', () => { }); }); - describe('.getBinaryFormat()', () => { - it('should get default binary formatter', () => { - provider = new NodeTracerProvider({}); - assert.ok( - provider.getTracer('default').getBinaryFormat() instanceof - BinaryTraceContext - ); - }); - }); - describe('.getHttpTextFormat()', () => { it('should get default HTTP text formatter', () => { provider = new NodeTracerProvider({}); diff --git a/packages/opentelemetry-tracing/src/Tracer.ts b/packages/opentelemetry-tracing/src/Tracer.ts index 6bff5f84d70..09b90117128 100644 --- a/packages/opentelemetry-tracing/src/Tracer.ts +++ b/packages/opentelemetry-tracing/src/Tracer.ts @@ -36,7 +36,6 @@ import { mergeConfig } from './utility'; */ export class Tracer implements types.Tracer { private readonly _defaultAttributes: types.Attributes; - private readonly _binaryFormat: types.BinaryFormat; private readonly _httpTextFormat: types.HttpTextFormat; private readonly _sampler: types.Sampler; private readonly _scopeManager: ScopeManager; @@ -51,7 +50,6 @@ export class Tracer implements types.Tracer { private _tracerProvider: BasicTracerProvider ) { const localConfig = mergeConfig(config); - this._binaryFormat = localConfig.binaryFormat; this._defaultAttributes = localConfig.defaultAttributes; this._httpTextFormat = localConfig.httpTextFormat; this._sampler = localConfig.sampler; @@ -141,13 +139,6 @@ export class Tracer implements types.Tracer { ); } - /** - * Returns the binary format interface which can serialize/deserialize Spans. - */ - getBinaryFormat(): types.BinaryFormat { - return this._binaryFormat; - } - /** * Returns the HTTP text format interface which can inject/extract Spans. */ diff --git a/packages/opentelemetry-tracing/src/config.ts b/packages/opentelemetry-tracing/src/config.ts index 9d7e983047c..6551ba71600 100644 --- a/packages/opentelemetry-tracing/src/config.ts +++ b/packages/opentelemetry-tracing/src/config.ts @@ -16,7 +16,6 @@ import { ALWAYS_SAMPLER, - BinaryTraceContext, HttpTraceContext, LogLevel, } from '@opentelemetry/core'; @@ -37,7 +36,6 @@ export const DEFAULT_MAX_LINKS_PER_SPAN = 32; */ export const DEFAULT_CONFIG = { defaultAttributes: {}, - binaryFormat: new BinaryTraceContext(), httpTextFormat: new HttpTraceContext(), logLevel: LogLevel.DEBUG, sampler: ALWAYS_SAMPLER, diff --git a/packages/opentelemetry-tracing/src/types.ts b/packages/opentelemetry-tracing/src/types.ts index e8ef51c0aee..7ab7c3b1bc8 100644 --- a/packages/opentelemetry-tracing/src/types.ts +++ b/packages/opentelemetry-tracing/src/types.ts @@ -17,7 +17,6 @@ import { ScopeManager } from '@opentelemetry/scope-base'; import { Attributes, - BinaryFormat, HttpTextFormat, Logger, Sampler, @@ -28,11 +27,6 @@ import { LogLevel } from '@opentelemetry/core'; * TracerConfig provides an interface for configuring a Basic Tracer. */ export interface TracerConfig { - /** - * Binary formatter which can serialize/deserialize Spans. - */ - binaryFormat?: BinaryFormat; - /** * Attributed that will be applied on every span created by Tracer. * Useful to add infrastructure and environment information to your spans. diff --git a/packages/opentelemetry-tracing/test/BasicTracerRegistry.test.ts b/packages/opentelemetry-tracing/test/BasicTracerRegistry.test.ts index f829de1ff76..19665036e98 100644 --- a/packages/opentelemetry-tracing/test/BasicTracerRegistry.test.ts +++ b/packages/opentelemetry-tracing/test/BasicTracerRegistry.test.ts @@ -17,7 +17,6 @@ import { Context, TraceFlags } from '@opentelemetry/api'; import { ALWAYS_SAMPLER, - BinaryTraceContext, HttpTraceContext, NEVER_SAMPLER, NoopLogger, @@ -36,13 +35,6 @@ describe('BasicTracerProvider', () => { assert.ok(provider instanceof BasicTracerProvider); }); - it('should construct an instance with binary format', () => { - const provider = new BasicTracerProvider({ - binaryFormat: new BinaryTraceContext(), - }); - assert.ok(provider instanceof BasicTracerProvider); - }); - it('should construct an instance with http text format', () => { const provider = new BasicTracerProvider({ httpTextFormat: new HttpTraceContext(), @@ -348,13 +340,6 @@ describe('BasicTracerProvider', () => { }); }); - describe('.getBinaryFormat()', () => { - it('should get default binary formatter', () => { - const tracer = new BasicTracerProvider().getTracer('default'); - assert.ok(tracer.getBinaryFormat() instanceof BinaryTraceContext); - }); - }); - describe('.getHttpTextFormat()', () => { it('should get default HTTP text formatter', () => { const tracer = new BasicTracerProvider().getTracer('default');