From d18c8442db451a749f6b6a3399fb294a7d7cb9cd Mon Sep 17 00:00:00 2001 From: Brandon Gonzalez Date: Fri, 20 Sep 2019 13:23:33 -0400 Subject: [PATCH] chore: remove all references to SpanData (#286) * chore: remove all references to SpanData * yarn fix --- .../opentelemetry-basic-tracer/src/BasicTracer.ts | 8 -------- .../test/BasicTracer.test.ts | 5 ----- packages/opentelemetry-core/src/trace/NoopTracer.ts | 3 --- .../opentelemetry-core/src/trace/TracerDelegate.ts | 8 -------- .../opentelemetry-core/test/trace/NoopTracer.test.ts | 2 -- .../test/trace/TracerDelegate.test.ts | 1 - .../test/trace/globaltracer-utils.test.ts | 1 - .../opentelemetry-node-sdk/test/NodeTracer.test.ts | 5 ----- .../test/functionals/http-disable.test.ts | 5 ----- packages/opentelemetry-types/src/trace/tracer.ts | 11 ----------- 10 files changed, 49 deletions(-) diff --git a/packages/opentelemetry-basic-tracer/src/BasicTracer.ts b/packages/opentelemetry-basic-tracer/src/BasicTracer.ts index 2e4c9e4b2ff..2b973694a16 100644 --- a/packages/opentelemetry-basic-tracer/src/BasicTracer.ts +++ b/packages/opentelemetry-basic-tracer/src/BasicTracer.ts @@ -142,14 +142,6 @@ export class BasicTracer implements types.Tracer { return this._scopeManager.bind(target, span); } - /** - * Records a SpanData. - */ - /* c8 ignore next 3 */ - recordSpanData(span: types.Span): void { - // TODO: notify exporter - } - /** * Returns the binary format interface which can serialize/deserialize Spans. */ diff --git a/packages/opentelemetry-basic-tracer/test/BasicTracer.test.ts b/packages/opentelemetry-basic-tracer/test/BasicTracer.test.ts index 1a3891a264d..ae48f2e5c47 100644 --- a/packages/opentelemetry-basic-tracer/test/BasicTracer.test.ts +++ b/packages/opentelemetry-basic-tracer/test/BasicTracer.test.ts @@ -350,11 +350,6 @@ describe('BasicTracer', () => { }); }); - describe('.recordSpanData()', () => { - // @todo: implement - it('should call exporters with span data'); - }); - describe('.getBinaryFormat()', () => { it('should get default binary formatter', () => { const tracer = new BasicTracer(); diff --git a/packages/opentelemetry-core/src/trace/NoopTracer.ts b/packages/opentelemetry-core/src/trace/NoopTracer.ts index a2abf9fbcd5..ea36a96ecfe 100644 --- a/packages/opentelemetry-core/src/trace/NoopTracer.ts +++ b/packages/opentelemetry-core/src/trace/NoopTracer.ts @@ -49,9 +49,6 @@ export class NoopTracer implements Tracer { return target; } - // By default does nothing - recordSpanData(span: Span): void {} - // By default does nothing getBinaryFormat(): BinaryFormat { return NOOP_BINARY_FORMAT; diff --git a/packages/opentelemetry-core/src/trace/TracerDelegate.ts b/packages/opentelemetry-core/src/trace/TracerDelegate.ts index 625d20106e2..73c0f39e49e 100644 --- a/packages/opentelemetry-core/src/trace/TracerDelegate.ts +++ b/packages/opentelemetry-core/src/trace/TracerDelegate.ts @@ -82,14 +82,6 @@ export class TracerDelegate implements types.Tracer { ); } - recordSpanData(span: types.Span): void { - return this._currentTracer.recordSpanData.apply( - this._currentTracer, - // tslint:disable-next-line:no-any - arguments as any - ); - } - getBinaryFormat(): types.BinaryFormat { return this._currentTracer.getBinaryFormat.apply( this._currentTracer, diff --git a/packages/opentelemetry-core/test/trace/NoopTracer.test.ts b/packages/opentelemetry-core/test/trace/NoopTracer.test.ts index 5f523a0f439..cd93d5b548e 100644 --- a/packages/opentelemetry-core/test/trace/NoopTracer.test.ts +++ b/packages/opentelemetry-core/test/trace/NoopTracer.test.ts @@ -37,8 +37,6 @@ describe('NoopTracer', () => { NOOP_SPAN ); - tracer.recordSpanData(NOOP_SPAN); - assert.deepStrictEqual(tracer.getCurrentSpan(), NOOP_SPAN); const httpTextFormat = tracer.getHttpTextFormat(); assert.ok(httpTextFormat); diff --git a/packages/opentelemetry-core/test/trace/TracerDelegate.test.ts b/packages/opentelemetry-core/test/trace/TracerDelegate.test.ts index 8fb186afd1e..cc8772f263d 100644 --- a/packages/opentelemetry-core/test/trace/TracerDelegate.test.ts +++ b/packages/opentelemetry-core/test/trace/TracerDelegate.test.ts @@ -26,7 +26,6 @@ describe('TracerDelegate', () => { 'startSpan', 'withSpan', 'bind', - 'recordSpanData', 'getBinaryFormat', 'getHttpTextFormat', ]; diff --git a/packages/opentelemetry-core/test/trace/globaltracer-utils.test.ts b/packages/opentelemetry-core/test/trace/globaltracer-utils.test.ts index e8702715be4..9d15b0d12fc 100644 --- a/packages/opentelemetry-core/test/trace/globaltracer-utils.test.ts +++ b/packages/opentelemetry-core/test/trace/globaltracer-utils.test.ts @@ -28,7 +28,6 @@ describe('globaltracer-utils', () => { 'getCurrentSpan', 'startSpan', 'withSpan', - 'recordSpanData', 'getBinaryFormat', 'getHttpTextFormat', ]; diff --git a/packages/opentelemetry-node-sdk/test/NodeTracer.test.ts b/packages/opentelemetry-node-sdk/test/NodeTracer.test.ts index 15a6810b00a..2f6d0a44c7e 100644 --- a/packages/opentelemetry-node-sdk/test/NodeTracer.test.ts +++ b/packages/opentelemetry-node-sdk/test/NodeTracer.test.ts @@ -233,11 +233,6 @@ describe('NodeTracer', () => { }); }); - describe('.recordSpanData()', () => { - // @todo: implement - it('should call exporters with span data'); - }); - describe('.getBinaryFormat()', () => { it('should get default binary formatter', () => { tracer = new NodeTracer({}); diff --git a/packages/opentelemetry-plugin-http/test/functionals/http-disable.test.ts b/packages/opentelemetry-plugin-http/test/functionals/http-disable.test.ts index ff4330767a0..78c24de3cbf 100644 --- a/packages/opentelemetry-plugin-http/test/functionals/http-disable.test.ts +++ b/packages/opentelemetry-plugin-http/test/functionals/http-disable.test.ts @@ -55,7 +55,6 @@ describe('HttpPlugin', () => { beforeEach(() => { tracer.startSpan = sinon.spy(); tracer.withSpan = sinon.spy(); - tracer.recordSpanData = sinon.spy(); }); afterEach(() => { @@ -78,10 +77,6 @@ describe('HttpPlugin', () => { false ); assert.strictEqual((tracer.withSpan as sinon.SinonSpy).called, false); - assert.strictEqual( - (tracer.recordSpanData as sinon.SinonSpy).called, - false - ); }); }); }); diff --git a/packages/opentelemetry-types/src/trace/tracer.ts b/packages/opentelemetry-types/src/trace/tracer.ts index 806f45e6597..051a53c1298 100644 --- a/packages/opentelemetry-types/src/trace/tracer.ts +++ b/packages/opentelemetry-types/src/trace/tracer.ts @@ -65,17 +65,6 @@ export interface Tracer { */ bind(target: T, span?: Span): T; - /** - * Send a pre-populated span object to the exporter. - * Sampling and recording decisions as well as other collection optimizations - * are the responsibility of a caller. - * - * @todo: Pending API discussion. Revisit if Span or SpanData should be passed - * in here once this is sorted out. - * @param span Span Data to be reported to all exporters. - */ - recordSpanData(span: Span): void; - /** * Returns the {@link BinaryFormat} interface which can serialize/deserialize * Spans.