refactor(opentelemetry-sdk-node): remove redundant judgments for metric (#2648)

This commit is contained in:
Ricky Zhou 2021-12-07 00:50:30 +08:00 committed by GitHub
parent 3959386463
commit b9e7835716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}