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