From 962453d360a57942d6b129563bac6c5f3a01f2d4 Mon Sep 17 00:00:00 2001 From: rickyes <0x19951125@gmail.com> Date: Sun, 5 Dec 2021 01:45:47 +0800 Subject: [PATCH] refactor(opentelemetry-sdk-node): remove redundant judgments for metric Signed-off-by: rickyes <0x19951125@gmail.com> --- 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; }