Skip to content

Commit 27bcd35

Browse files
squash: Add comments
To explain the lack of test coverage
1 parent d91e172 commit 27bcd35

File tree

1 file changed

+3
-0
lines changed
  • instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers

1 file changed

+3
-0
lines changed

instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def finish(_name, _id, payload)
5353
# @return [Array<String, Hash>] the span name and attributes
5454
def to_span_name_and_attributes(payload)
5555
request = payload[:request]
56+
# It seems that there are cases in Rails functional tests where it bypasses the routing system and the `action_dispatch.route_uri_pattern` header not being set.
57+
# Our Test suite executes the routing system so we are unable to recreate this error case.
58+
# https://github.com/rails/rails/blob/747f85f200e7bb2c1a31b4e26e5a5655e2dc0cdc/actionpack/lib/action_dispatch/http/request.rb#L160
5659
http_route = request.route_uri_pattern&.chomp('(.:format)') if request.respond_to?(:route_uri_pattern)
5760

5861
attributes = {

0 commit comments

Comments
 (0)