diff --git a/sdk/lib/opentelemetry/sdk/correlation_context.rb b/sdk/lib/opentelemetry/sdk/correlation_context.rb index 2b0976846e..66508368da 100644 --- a/sdk/lib/opentelemetry/sdk/correlation_context.rb +++ b/sdk/lib/opentelemetry/sdk/correlation_context.rb @@ -9,7 +9,7 @@ module OpenTelemetry module SDK - # Contains operational implementataions of the CorrelationContext::Manager + # Contains operational implementations of the CorrelationContext::Manager module CorrelationContext end end diff --git a/sdk/lib/opentelemetry/sdk/resources/auto_detector.rb b/sdk/lib/opentelemetry/sdk/resources/auto_detector.rb index 961f97c268..26d8bd5035 100644 --- a/sdk/lib/opentelemetry/sdk/resources/auto_detector.rb +++ b/sdk/lib/opentelemetry/sdk/resources/auto_detector.rb @@ -17,7 +17,7 @@ module AutoDetector DETECTORS = [ OpenTelemetry::SDK::Resources::Detectors::GoogleCloudPlatform, OpenTelemetry::SDK::Resources::Detectors::Telemetry - ] + ].freeze def detect resources = DETECTORS.map(&:detect) diff --git a/sdk/lib/opentelemetry/sdk/resources/detectors/google_cloud_platform.rb b/sdk/lib/opentelemetry/sdk/resources/detectors/google_cloud_platform.rb index 34bcdaa37e..33cfd68d11 100644 --- a/sdk/lib/opentelemetry/sdk/resources/detectors/google_cloud_platform.rb +++ b/sdk/lib/opentelemetry/sdk/resources/detectors/google_cloud_platform.rb @@ -44,7 +44,7 @@ def detect def hostname ENV['HOSTNAME'] || `hostname`&.strip - rescue StandardError => e + rescue StandardError '' end end diff --git a/sdk/opentelemetry-sdk.gemspec b/sdk/opentelemetry-sdk.gemspec index a84b9981a9..40445ef28e 100644 --- a/sdk/opentelemetry-sdk.gemspec +++ b/sdk/opentelemetry-sdk.gemspec @@ -25,8 +25,8 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.required_ruby_version = '>= 2.5.0' - spec.add_dependency 'opentelemetry-api', '~> 0.4.0' spec.add_dependency 'google-cloud-env' + spec.add_dependency 'opentelemetry-api', '~> 0.4.0' spec.add_development_dependency 'bundler', '>= 1.17' spec.add_development_dependency 'faraday', '~> 0.13' diff --git a/sdk/test/opentelemetry/sdk/resources/detectors/google_cloud_platform_test.rb b/sdk/test/opentelemetry/sdk/resources/detectors/google_cloud_platform_test.rb index 30b78116b8..f6ab7da512 100644 --- a/sdk/test/opentelemetry/sdk/resources/detectors/google_cloud_platform_test.rb +++ b/sdk/test/opentelemetry/sdk/resources/detectors/google_cloud_platform_test.rb @@ -24,11 +24,11 @@ mock = MiniTest::Mock.new mock.expect(:compute_engine?, true) mock.expect(:project_id, 'opentelemetry') - mock.expect(:instance_attribute, 'us-central1', %w(cluster-location)) + mock.expect(:instance_attribute, 'us-central1', %w[cluster-location]) mock.expect(:instance_zone, 'us-central1-a') - mock.expect(:lookup_metadata, 'opentelemetry-test', %w(instance id)) - mock.expect(:lookup_metadata, 'opentelemetry-test', %w(instance hostname)) - mock.expect(:instance_attribute, 'opentelemetry-cluster', %w(cluster-name)) + mock.expect(:lookup_metadata, 'opentelemetry-test', %w[instance id]) + mock.expect(:lookup_metadata, 'opentelemetry-test', %w[instance hostname]) + mock.expect(:instance_attribute, 'opentelemetry-cluster', %w[cluster-name]) mock.expect(:kubernetes_engine?, true) mock.expect(:kubernetes_engine_namespace_id, 'default')