Skip to content

Commit f2781df

Browse files
committed
lint
1 parent e625a80 commit f2781df

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

opentelemetry-auto-instrumentation/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ source 'https://rubygems.org'
99
gemspec
1010

1111
group :test do
12-
gem 'bundler'
12+
gem 'bundler'
1313
gem 'minitest'
1414
gem 'rake'
1515
gem 'rubocop'
@@ -22,4 +22,4 @@ group :test do
2222
gem 'bigdecimal'
2323
gem 'mutex_m'
2424
end
25-
end
25+
end

opentelemetry-auto-instrumentation/lib/opentelemetry-auto-instrumentation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def detect_resource_from_env
6868
when 'azure'
6969
additional_resource = additional_resource.merge(::OpenTelemetry::Resource::Detector::Azure.detect) if defined? ::OpenTelemetry::Resource::Detector::Azure
7070
when 'aws'
71-
additional_resource = additional_resource.merge(::OpenTelemetry::Resource::Detector::AWS.detect([:ec2, :ecs, :eks, :lambda])) if defined? ::OpenTelemetry::Resource::Detector::AWS
71+
additional_resource = additional_resource.merge(::OpenTelemetry::Resource::Detector::AWS.detect(%i[ec2 ecs eks lambda])) if defined? ::OpenTelemetry::Resource::Detector::AWS
7272
end
7373
end
7474

@@ -105,7 +105,7 @@ def initialize_opentelemetry
105105
end
106106
OpenTelemetry.logger.info { 'Auto-instrumentation initialized' }
107107
rescue StandardError => e
108-
$stderr.puts "Auto-instrumentation failed to initialize. Error: #{e.message}"
108+
warn "Auto-instrumentation failed to initialize. Error: #{e.message}"
109109
end
110110
end
111111
end

opentelemetry-auto-instrumentation/opentelemetry-auto-instrumentation.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ Gem::Specification.new do |spec|
3131
spec.add_dependency 'opentelemetry-helpers-mysql', '~> 0.2.0'
3232
spec.add_dependency 'opentelemetry-helpers-sql-obfuscation', '~> 0.3.0'
3333
spec.add_dependency 'opentelemetry-instrumentation-all', '~> 0.72.0'
34+
spec.add_dependency 'opentelemetry-resource-detector-aws', '~> 0.2.0'
3435
spec.add_dependency 'opentelemetry-resource-detector-azure', '~> 0.2.0'
3536
spec.add_dependency 'opentelemetry-resource-detector-container', '~> 0.2.0'
3637
spec.add_dependency 'opentelemetry-resource-detector-google_cloud_platform', '~> 0.2.0'
37-
spec.add_dependency 'opentelemetry-resource-detector-aws', '~> 0.2.0'
3838
spec.add_dependency 'opentelemetry-sdk', '~> 1.6.0'
3939

4040
if spec.respond_to?(:metadata)

opentelemetry-auto-instrumentation/test/opentelemetry-auto-instrumentation_test.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@
1313

1414
after do
1515
# Clean up constants and methods if they exist
16-
if defined?(OTelBundlerPatch::Initializer::OTEL_INSTRUMENTATION_MAP)
17-
OTelBundlerPatch::Initializer.send(:remove_const, :OTEL_INSTRUMENTATION_MAP)
18-
end
16+
OTelBundlerPatch::Initializer.send(:remove_const, :OTEL_INSTRUMENTATION_MAP) if defined?(OTelBundlerPatch::Initializer::OTEL_INSTRUMENTATION_MAP)
1917

20-
if defined?(OTelBundlerPatch::Initializer)
21-
OTelBundlerPatch.send(:remove_const, :Initializer)
22-
end
18+
OTelBundlerPatch.send(:remove_const, :Initializer) if defined?(OTelBundlerPatch::Initializer)
2319

2420
%i[require].each do |method|
25-
if OTelBundlerPatch.method_defined?(method)
26-
OTelBundlerPatch.send(:undef_method, method)
27-
end
28-
end # Reset instrumentation installation state
21+
OTelBundlerPatch.send(:undef_method, method) if OTelBundlerPatch.method_defined?(method)
22+
end
2923
[
3024
OpenTelemetry::Instrumentation::Net::HTTP::Instrumentation,
3125
OpenTelemetry::Instrumentation::Rake::Instrumentation

opentelemetry-auto-instrumentation/test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
require 'opentelemetry-instrumentation-all'
1212
require 'opentelemetry-test-helpers'
1313
require 'opentelemetry/resource/detector'
14-
require 'net/http'
14+
require 'net/http'

0 commit comments

Comments
 (0)