@@ -17,6 +17,7 @@ use common::{
1717 Query ,
1818 } ,
1919 ExtractClientVersion ,
20+ ExtractRequestId ,
2021 HttpResponseError ,
2122 } ,
2223 pause:: PauseClient ,
@@ -25,7 +26,6 @@ use common::{
2526 FunctionCaller ,
2627 } ,
2728 version:: ClientVersion ,
28- RequestId ,
2929} ;
3030use errors:: ErrorMetadata ;
3131use isolate:: UdfArgsJson ;
@@ -137,6 +137,7 @@ impl UdfResponse {
137137/// Executes an arbitrary query/mutation/action from its name.
138138pub async fn public_function_post (
139139 State ( st) : State < LocalAppState > ,
140+ ExtractRequestId ( request_id) : ExtractRequestId ,
140141 ExtractIdentity ( identity) : ExtractIdentity ,
141142 ExtractClientVersion ( client_version) : ExtractClientVersion ,
142143 Json ( req) : Json < UdfPostRequest > ,
@@ -147,10 +148,6 @@ pub async fn public_function_post(
147148 return Result :: Err ( anyhow ! ( bad_admin_key_error( Some ( st. instance_name. clone( ) ) ) ) . into ( ) ) ;
148149 }
149150
150- // TODO: Move generating request_id and configuring sentry axum middleware.
151- let request_id = RequestId :: new ( ) ;
152- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
153-
154151 let udf_path = parse_udf_path ( & req. path ) ?;
155152 let udf_result = st
156153 . application
@@ -205,16 +202,14 @@ pub fn export_value(
205202pub async fn public_query_get (
206203 State ( st) : State < LocalAppState > ,
207204 Query ( req) : Query < UdfArgsQuery > ,
205+ ExtractRequestId ( request_id) : ExtractRequestId ,
208206 ExtractIdentity ( identity) : ExtractIdentity ,
209207 ExtractClientVersion ( client_version) : ExtractClientVersion ,
210208) -> Result < impl IntoResponse , HttpResponseError > {
211209 let udf_path = req. path . parse ( ) . context ( ErrorMetadata :: bad_request (
212210 "InvalidConvexFunction" ,
213211 format ! ( "Failed to parse Convex function path: {}" , req. path) ,
214212 ) ) ?;
215- // TODO: Move generating request_id and configuring sentry axum middleware.
216- let request_id = RequestId :: new ( ) ;
217- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
218213 let args = req. args . into_arg_vec ( ) ;
219214 let udf_return = st
220215 . application
@@ -242,6 +237,7 @@ pub async fn public_query_get(
242237
243238pub async fn public_query_post (
244239 State ( st) : State < LocalAppState > ,
240+ ExtractRequestId ( request_id) : ExtractRequestId ,
245241 ExtractIdentity ( identity) : ExtractIdentity ,
246242 ExtractClientVersion ( client_version) : ExtractClientVersion ,
247243 Json ( req) : Json < UdfPostRequest > ,
@@ -250,9 +246,6 @@ pub async fn public_query_post(
250246 "InvalidConvexFunction" ,
251247 format ! ( "Failed to parse Convex function path: {}" , req. path) ,
252248 ) ) ?;
253- // TODO: Move generating request_id and configuring sentry axum middleware.
254- let request_id = RequestId :: new ( ) ;
255- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
256249 let udf_return = st
257250 . application
258251 . read_only_udf (
@@ -289,15 +282,13 @@ pub struct QueryBatchResponse {
289282
290283pub async fn public_query_batch_post (
291284 State ( st) : State < LocalAppState > ,
285+ ExtractRequestId ( request_id) : ExtractRequestId ,
292286 ExtractIdentity ( identity) : ExtractIdentity ,
293287 ExtractClientVersion ( client_version) : ExtractClientVersion ,
294288 Json ( req_batch) : Json < QueryBatchArgs > ,
295289) -> Result < impl IntoResponse , HttpResponseError > {
296290 let mut results = vec ! [ ] ;
297291 let ts = * st. application . now_ts_for_reads ( ) ;
298- // TODO: Move generating request_id and configuring sentry axum middleware.
299- let request_id = RequestId :: new ( ) ;
300- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
301292 for req in req_batch. queries {
302293 let value_format = req. format . as_ref ( ) . map ( |f| f. parse ( ) ) . transpose ( ) ?;
303294 let udf_path = parse_udf_path ( & req. path ) ?;
@@ -333,14 +324,12 @@ pub async fn public_query_batch_post(
333324
334325pub async fn public_mutation_post (
335326 State ( st) : State < LocalAppState > ,
327+ ExtractRequestId ( request_id) : ExtractRequestId ,
336328 ExtractIdentity ( identity) : ExtractIdentity ,
337329 ExtractClientVersion ( client_version) : ExtractClientVersion ,
338330 Json ( req) : Json < UdfPostRequest > ,
339331) -> Result < impl IntoResponse , HttpResponseError > {
340332 let udf_path = parse_udf_path ( & req. path ) ?;
341- // TODO: Move generating request_id and configuring sentry axum middleware.
342- let request_id = RequestId :: new ( ) ;
343- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
344333 let udf_result = st
345334 . application
346335 . mutation_udf (
@@ -372,13 +361,11 @@ pub async fn public_mutation_post(
372361
373362pub async fn public_action_post (
374363 State ( st) : State < LocalAppState > ,
364+ ExtractRequestId ( request_id) : ExtractRequestId ,
375365 ExtractIdentity ( identity) : ExtractIdentity ,
376366 ExtractClientVersion ( client_version) : ExtractClientVersion ,
377367 Json ( req) : Json < UdfPostRequest > ,
378368) -> Result < impl IntoResponse , HttpResponseError > {
379- // TODO: Move generating request_id and configuring sentry axum middleware.
380- let request_id = RequestId :: new ( ) ;
381- sentry:: configure_scope ( |scope| scope. set_tag ( "request_id" , request_id. clone ( ) ) ) ;
382369 let udf_path = parse_udf_path ( & req. path ) ?;
383370 let action_result = st
384371 . application
0 commit comments