From b9e7835716d56dba7e6f9f0e45a2a31dd7022391 Mon Sep 17 00:00:00 2001 From: Ricky Zhou <0x19951125@gmail.com> Date: Tue, 7 Dec 2021 00:50:30 +0800 Subject: [PATCH] refactor(opentelemetry-sdk-node): remove redundant judgments for metric (#2648) --- experimental/packages/opentelemetry-sdk-node/src/sdk.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/experimental/packages/opentelemetry-sdk-node/src/sdk.ts b/experimental/packages/opentelemetry-sdk-node/src/sdk.ts index 74c791fa6e..cf014d6bd2 100644 --- a/experimental/packages/opentelemetry-sdk-node/src/sdk.ts +++ b/experimental/packages/opentelemetry-sdk-node/src/sdk.ts @@ -84,14 +84,13 @@ export class NodeSDK { } if (configuration.metricExporter) { - const meterConfig: MeterConfig = {}; + const meterConfig: MeterConfig = { + exporter: configuration.metricExporter, + }; if (configuration.metricProcessor) { meterConfig.processor = configuration.metricProcessor; } - if (configuration.metricExporter) { - meterConfig.exporter = configuration.metricExporter; - } if (typeof configuration.metricInterval === 'number') { meterConfig.interval = configuration.metricInterval; }