From b5f39ea815d807b851b79ed1a4d523007f2a0051 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Tue, 29 Oct 2024 12:49:54 -0700 Subject: [PATCH] style: Rubocop lines in block --- .../sdk/metrics/configuration_patch.rb | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/metrics_sdk/lib/opentelemetry/sdk/metrics/configuration_patch.rb b/metrics_sdk/lib/opentelemetry/sdk/metrics/configuration_patch.rb index cc163187e..f9ee2c07f 100644 --- a/metrics_sdk/lib/opentelemetry/sdk/metrics/configuration_patch.rb +++ b/metrics_sdk/lib/opentelemetry/sdk/metrics/configuration_patch.rb @@ -37,29 +37,17 @@ def wrapped_metric_exporters_from_env exporters.split(',').map do |exporter| case exporter.strip when 'none' then nil - when 'console' - OpenTelemetry.meter_provider.add_metric_reader( - Metrics::Export::PeriodicMetricReader.new( - exporter: Metrics::Export::ConsoleMetricPullExporter.new - ) - ) - when 'in-memory' - OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::InMemoryMetricPullExporter.new) + when 'console' then OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::PeriodicMetricReader.new(exporter: Metrics::Export::ConsoleMetricPullExporter.new)) + when 'in-memory' then OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::InMemoryMetricPullExporter.new) when 'otlp' begin - OpenTelemetry.meter_provider.add_metric_reader( - Metrics::Export::PeriodicMetricReader.new( - exporter: OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter.new - ) - ) + OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::PeriodicMetricReader.new(exporter: OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter.new)) rescue NameError - OpenTelemetry.logger.warn 'The otlp metrics exporter cannot be configured - please add ' \ - 'opentelemetry-exporter-otlp-metrics to your Gemfile, metrics will not be exported' + OpenTelemetry.logger.warn 'The otlp metrics exporter cannot be configured - please add opentelemetry-exporter-otlp-metrics to your Gemfile, metrics will not be exported' nil end else - OpenTelemetry.logger.warn "The #{exporter} exporter is unknown and cannot be configured, " \ - 'metrics will not be exported' + OpenTelemetry.logger.warn "The #{exporter} exporter is unknown and cannot be configured, metrics will not be exported" nil end end