Skip to content

Commit e89fe75

Browse files
committed
test: Add test for http.route cleaning
1 parent e081529 commit e89fe75

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
_(span.attributes['code.function']).must_equal 'ok'
5959
end
6060

61+
it 'strips (:format) from http.route' do
62+
skip "Rails #{Rails.gem_version} does not define ActionDispatch::Request#route_uri_pattern" if Rails.gem_version < Gem::Version.new('7.1')
63+
64+
get 'items/1234'
65+
66+
_(span.attributes['http.route']).must_equal '/items/:id'
67+
end
68+
6169
it 'does not memoize data across requests' do
6270
get '/ok'
6371
get '/items/new'

0 commit comments

Comments
 (0)