Skip to content

Commit

Permalink
fix: remove attributes from OTLPExporterConfigBase
Browse files Browse the repository at this point in the history
Remove the optional attributes property from OTLPExporterConfigBase because it's
not part of the spec and it's actually not exported at all.
  • Loading branch information
Flarna committed May 24, 2022
1 parent 610808d commit be3df87
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe('OTLPTraceExporter - web', () => {
onInitSpy = sinon.stub(OTLPTraceExporter.prototype, 'onInit');
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
collectorTraceExporter = new OTLPTraceExporter(collectorExporterConfig);
Expand Down Expand Up @@ -86,7 +85,6 @@ describe('OTLPTraceExporter - web', () => {
beforeEach(() => {
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ describe('OTLPTraceExporter - node with json over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
httpAgentOptions: { keepAliveMsecs: 2000 },
Expand Down Expand Up @@ -394,7 +393,6 @@ describe('OTLPTraceExporter - node with json over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
compression: CompressionAlgorithm.GZIP,
Expand Down Expand Up @@ -469,7 +467,6 @@ describe('OTLPTraceExporter - node with json over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
httpAgentOptions: { keepAliveMsecs: 2000 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ describe('OTLPTraceExporter - node with proto over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
httpAgentOptions: { keepAliveMsecs: 2000 },
Expand Down Expand Up @@ -273,7 +272,6 @@ describe('OTLPTraceExporter - node with proto over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
compression: CompressionAlgorithm.GZIP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('OTLPMetricExporter - common', () => {
onInitSpy = sinon.stub(OTLPMetricExporter.prototype, 'onInit');
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
collectorExporter = new OTLPMetricExporter(collectorExporterConfig);
Expand Down Expand Up @@ -182,7 +181,6 @@ describe('OTLPMetricExporter - common', () => {
);
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
collectorExporter = new OTLPMetricExporter(collectorExporterConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ describe('OTLPMetricExporter - node with json over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
httpAgentOptions: { keepAliveMsecs: 2000 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ describe('OTLPMetricExporter - node with proto over http', () => {
foo: 'bar',
},
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
keepAlive: true,
httpAgentOptions: { keepAliveMsecs: 2000 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { SpanAttributes, diag } from '@opentelemetry/api';
import { diag } from '@opentelemetry/api';
import { ExportResult, ExportResultCode, BindOnceFuture } from '@opentelemetry/core';
import {
OTLPExporterError,
Expand All @@ -33,7 +33,6 @@ export abstract class OTLPExporterBase<
> {
public readonly url: string;
public readonly hostname: string | undefined;
public readonly attributes?: SpanAttributes;
public readonly timeoutMillis: number;
protected _concurrencyLimit: number;
protected _sendingPromises: Promise<unknown>[] = [];
Expand All @@ -48,8 +47,6 @@ export abstract class OTLPExporterBase<
this.hostname = config.hostname;
}

this.attributes = config.attributes;

this.shutdown = this.shutdown.bind(this);
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);

Expand Down
3 changes: 0 additions & 3 deletions experimental/packages/otlp-exporter-base/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import { SpanAttributes } from '@opentelemetry/api';

/**
* Interface for handling error
*/
Expand Down Expand Up @@ -49,7 +47,6 @@ export interface ExportServiceError {
export interface OTLPExporterConfigBase {
headers?: Partial<Record<string, unknown>>;
hostname?: string;
attributes?: SpanAttributes;
url?: string;
concurrencyLimit?: number;
/** Maximum time the OTLP exporter will wait for each batch export.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ describe('OTLPTraceExporter - common', () => {
onInitSpy = sinon.stub(OTLPTraceExporter.prototype, 'onInit');
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
collectorExporter = new OTLPTraceExporter(collectorExporterConfig);
Expand Down Expand Up @@ -207,7 +206,6 @@ describe('OTLPTraceExporter - common', () => {
);
collectorExporterConfig = {
hostname: 'foo',
attributes: {},
url: 'http://foo.bar.com',
};
collectorExporter = new OTLPTraceExporter(collectorExporterConfig);
Expand Down

0 comments on commit be3df87

Please sign in to comment.