diff --git a/instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb b/instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb index b39fafe33..7228247fc 100644 --- a/instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb +++ b/instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb @@ -96,7 +96,7 @@ def path(endpoint) version = endpoint.routes.first.options[:version] || '' prefix = endpoint.routes.first.options[:prefix]&.to_s || '' parts = [prefix, version] + namespace.split('/') + endpoint.options[:path] - parts.reject { |p| p.blank? || p.eql?('/') }.join('/').prepend('/') + parts.reject { |p| p.nil? || p.empty? || p.eql?('/') }.join('/').prepend('/') end def formatter_type(formatter)