Module: Datadog::Tracing::Contrib::ActionPack::ActionDispatch::Instrumentation::Journey::LazyRouter

Defined in:
lib/datadog/tracing/contrib/action_pack/action_dispatch/instrumentation.rb

Overview

Since Rails 7.1 ‘Router#find_routes` makes the route computation lazy github.com/rails/rails/commit/35b280fcc2d5d474f9f2be3aca3ae7aa6bba66eb

Instance Method Summary collapse

Instance Method Details

#find_routes(req) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/datadog/tracing/contrib/action_pack/action_dispatch/instrumentation.rb', line 62

def find_routes(req)
  super do |match, parameters, route|
    if Instrumentation.dispatcher_route?(route)
      Instrumentation.set_http_route_tags(route.path.spec, req.env['SCRIPT_NAME'])
    end

    yield [match, parameters, route]
  end
end