diff --git a/bin/prometheus_exporter b/bin/prometheus_exporter index 387d8eb..dd6f76b 100755 --- a/bin/prometheus_exporter +++ b/bin/prometheus_exporter @@ -88,7 +88,7 @@ def run end if custom_collector_filename - eval File.read(custom_collector_filename), nil, File.expand_path(custom_collector_filename) + require File.expand_path(custom_collector_filename) found = false base_klass = PrometheusExporter::Server::CollectorBase @@ -108,7 +108,7 @@ def run if custom_type_collectors_filenames.length > 0 custom_type_collectors_filenames.each do |t| - eval File.read(t), nil, File.expand_path(t) + require File.expand_path(t) end ObjectSpace.each_object(Class) do |klass| diff --git a/lib/prometheus_exporter/instrumentation/sidekiq.rb b/lib/prometheus_exporter/instrumentation/sidekiq.rb index 8ae881c..375467d 100644 --- a/lib/prometheus_exporter/instrumentation/sidekiq.rb +++ b/lib/prometheus_exporter/instrumentation/sidekiq.rb @@ -73,7 +73,7 @@ module PrometheusExporter::Instrumentation # of the delayed extensions # https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/extensions/class_methods.rb begin - (target, method_name, _args) = YAML.load(msg['args'].first) + (target, method_name, _args) = YAML.safe_load(msg['args'].first) if target.class == Class "#{target.name}##{method_name}" else