From d03eb67390f4d5f3ae327d07714b6eea38b2e60b Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Fri, 3 Sep 2021 11:53:08 +0200 Subject: [PATCH] chore(exporter-collector): fix lint warnings --- .../src/platform/browser/CollectorMetricExporter.ts | 2 +- .../src/platform/node/CollectorExporterNodeBase.ts | 1 + .../src/platform/node/CollectorMetricExporter.ts | 2 +- packages/opentelemetry-exporter-collector/src/types.ts | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorMetricExporter.ts b/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorMetricExporter.ts index bfd7697235f..80127d5e4b8 100644 --- a/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorMetricExporter.ts +++ b/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorMetricExporter.ts @@ -57,7 +57,7 @@ export class CollectorMetricExporter ); } - getDefaultUrl(config: CollectorExporterConfigBase) { + getDefaultUrl(config: CollectorExporterConfigBase): string { return typeof config.url === 'string' ? config.url : getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0 diff --git a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts index a60993e84c4..670569815b9 100644 --- a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts +++ b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorExporterNodeBase.ts @@ -43,6 +43,7 @@ export abstract class CollectorExporterNodeBase< constructor(config: CollectorExporterNodeConfigBase = {}) { super(config); + // eslint-disable-next-line @typescript-eslint/no-explicit-any if ((config as any).metadata) { diag.warn('Metadata cannot be set when using http'); } diff --git a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorMetricExporter.ts b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorMetricExporter.ts index 1be12d369f8..d1aa0555b57 100644 --- a/packages/opentelemetry-exporter-collector/src/platform/node/CollectorMetricExporter.ts +++ b/packages/opentelemetry-exporter-collector/src/platform/node/CollectorMetricExporter.ts @@ -57,7 +57,7 @@ export class CollectorMetricExporter ); } - getDefaultUrl(config: CollectorExporterNodeConfigBase) { + getDefaultUrl(config: CollectorExporterNodeConfigBase): string { return typeof config.url === 'string' ? config.url : getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0 diff --git a/packages/opentelemetry-exporter-collector/src/types.ts b/packages/opentelemetry-exporter-collector/src/types.ts index e8ae3ff65e4..d30bc534253 100644 --- a/packages/opentelemetry-exporter-collector/src/types.ts +++ b/packages/opentelemetry-exporter-collector/src/types.ts @@ -203,6 +203,7 @@ export namespace opentelemetryProto { droppedAttributesCount: number; } + // eslint-disable-next-line @typescript-eslint/no-shadow export enum SpanKind { SPAN_KIND_UNSPECIFIED, SPAN_KIND_INTERNAL,