Skip to content

Commit

Permalink
style: Rubocop lines in block
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Oct 29, 2024
1 parent 94b71b0 commit b5f39ea
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions metrics_sdk/lib/opentelemetry/sdk/metrics/configuration_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5f39ea

Please sign in to comment.