Skip to content

Commit 2c2b9f8

Browse files
Update zero-code-instrumentation/lib/zero-code-instrumentation.rb
Co-authored-by: Ariel Valentin <[email protected]>
1 parent e1e4d20 commit 2c2b9f8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

zero-code-instrumentation/lib/zero-code-instrumentation.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@ def require_otel
122122
unload_libraries = ENV['UNLOAD_LIBRARY'].to_s.split(';')
123123
loaded_library_file_path = Array.new
124124

125-
Dir.glob("#{additional_gem_path}/gems/*").each do |file_path|
125+
loaded_library_file_path = Dir.glob("#{additional_gem_path}/gems/*").select do |file_path|
126126
gem_name = file_path.match(/\/gems\/([^\/]+)-\d/)[1]
127-
include_file = (file_path.include?('opentelemetry') || file_path.include?('google')) && !unload_libraries.include? gem_name
128-
loaded_library_file_path << file_path if include_file
127+
(file_path.include?('opentelemetry') || file_path.include?('google')) && !unload_libraries.include? gem_name
129128
end
130129

131130
puts "Loaded Library File Paths " + loaded_library_file_path.join(",") if ENV['ZERO_CODE_DEBUG'] == 'true'

0 commit comments

Comments
 (0)