Skip to content
/ bits Public

Commit 46c9d6a

Browse files
committed
Fix HTTP span naming by moving wrap-reitit-route to router
Route-level middleware runs after Reitit injects the match, so wrap-reitit-route can find the template and update the span name to include the route (e.g., "GET /login" instead of just "GET").
1 parent ac603c0 commit 46c9d6a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/bits/service.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@
135135
(ring/router
136136
routes
137137
{:data {:coercion coercion.malli/coercion
138-
:middleware [exception-middleware
138+
:middleware [trace.http/wrap-reitit-route
139+
exception-middleware
139140
ring.coercion/coerce-request-middleware
140141
mw/page-middleware]}})
141142

@@ -170,7 +171,6 @@
170171
[mw/wrap-secure-headers]
171172
[mw/wrap-locale]]]
172173
(-> (ring/ring-handler router handler {:middleware middleware})
173-
trace.http/wrap-reitit-route
174174
(trace.http/wrap-server-span {:create-span? true}))))
175175

176176
;;; ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)