From c53efcfab8936b8dff639a53456af0384a920fde Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sun, 5 Mar 2023 08:33:08 -0600 Subject: [PATCH] fix: test case --- .../lib/opentelemetry/instrumentation/rack/instrumentation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/instrumentation.rb b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/instrumentation.rb index d7f6b4204..38c000c17 100644 --- a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/instrumentation.rb +++ b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/instrumentation.rb @@ -18,7 +18,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base end present do - defined?(::Rack) + defined?(::Rack) && defined?(::Rack::Events) end option :allowed_request_headers, default: [], validate: :array @@ -49,7 +49,7 @@ def middleware_args private def require_dependencies - require_relative 'middlewares/event_handler' if defined?(Rack::Events) + require_relative 'middlewares/event_handler' require_relative 'middlewares/tracer_middleware' end