@@ -19,7 +19,7 @@ use shuttle_common::project::ProjectName;
19
19
use shuttle_common:: LogItem ;
20
20
use tower_http:: auth:: RequireAuthorizationLayer ;
21
21
use tower_http:: trace:: TraceLayer ;
22
- use tracing:: { debug, debug_span, error, field, trace, Span } ;
22
+ use tracing:: { debug, debug_span, error, field, instrument , trace, Span } ;
23
23
use tracing_opentelemetry:: OpenTelemetrySpanExt ;
24
24
use uuid:: Uuid ;
25
25
@@ -121,6 +121,7 @@ pub fn make_router(
121
121
. layer ( Extension ( project_name) )
122
122
}
123
123
124
+ #[ instrument( skip_all) ]
124
125
async fn list_services (
125
126
Extension ( persistence) : Extension < Persistence > ,
126
127
) -> Result < Json < Vec < shuttle_common:: models:: service:: Response > > > {
@@ -134,9 +135,10 @@ async fn list_services(
134
135
Ok ( Json ( services) )
135
136
}
136
137
138
+ #[ instrument( skip( persistence) ) ]
137
139
async fn get_service (
138
140
Extension ( persistence) : Extension < Persistence > ,
139
- Path ( ( _project_name , service_name) ) : Path < ( String , String ) > ,
141
+ Path ( ( project_name , service_name) ) : Path < ( String , String ) > ,
140
142
) -> Result < Json < shuttle_common:: models:: service:: Detailed > > {
141
143
if let Some ( service) = persistence. get_service_by_name ( & service_name) . await ? {
142
144
let deployments = persistence
@@ -171,10 +173,11 @@ async fn get_service(
171
173
}
172
174
}
173
175
176
+ #[ instrument( skip_all, fields( %project_name, %service_name) ) ]
174
177
async fn get_service_summary (
175
178
Extension ( persistence) : Extension < Persistence > ,
176
179
Extension ( proxy_fqdn) : Extension < FQDN > ,
177
- Path ( ( _ , service_name) ) : Path < ( String , String ) > ,
180
+ Path ( ( project_name , service_name) ) : Path < ( String , String ) > ,
178
181
) -> Result < Json < shuttle_common:: models:: service:: Summary > > {
179
182
if let Some ( service) = persistence. get_service_by_name ( & service_name) . await ? {
180
183
let deployment = persistence
@@ -201,10 +204,11 @@ async fn get_service_summary(
201
204
}
202
205
}
203
206
207
+ #[ instrument( skip_all, fields( %project_name, %service_name) ) ]
204
208
async fn post_service (
205
209
Extension ( persistence) : Extension < Persistence > ,
206
210
Extension ( deployment_manager) : Extension < DeploymentManager > ,
207
- Path ( ( _project_name , service_name) ) : Path < ( String , String ) > ,
211
+ Path ( ( project_name , service_name) ) : Path < ( String , String ) > ,
208
212
Query ( params) : Query < HashMap < String , String > > ,
209
213
mut stream : BodyStream ,
210
214
) -> Result < Json < shuttle_common:: models:: deployment:: Response > > {
@@ -243,10 +247,11 @@ async fn post_service(
243
247
Ok ( Json ( deployment. into ( ) ) )
244
248
}
245
249
250
+ #[ instrument( skip_all, fields( %project_name, %service_name) ) ]
246
251
async fn delete_service (
247
252
Extension ( persistence) : Extension < Persistence > ,
248
253
Extension ( deployment_manager) : Extension < DeploymentManager > ,
249
- Path ( ( _project_name , service_name) ) : Path < ( String , String ) > ,
254
+ Path ( ( project_name , service_name) ) : Path < ( String , String ) > ,
250
255
) -> Result < Json < shuttle_common:: models:: service:: Detailed > > {
251
256
if let Some ( service) = persistence. get_service_by_name ( & service_name) . await ? {
252
257
let old_deployments = persistence
@@ -285,9 +290,10 @@ async fn delete_service(
285
290
}
286
291
}
287
292
293
+ #[ instrument( skip_all, fields( %project_name, %deployment_id) ) ]
288
294
async fn get_deployment (
289
295
Extension ( persistence) : Extension < Persistence > ,
290
- Path ( ( _project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
296
+ Path ( ( project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
291
297
) -> Result < Json < shuttle_common:: models:: deployment:: Response > > {
292
298
if let Some ( deployment) = persistence. get_deployment ( & deployment_id) . await ? {
293
299
Ok ( Json ( deployment. into ( ) ) )
@@ -296,10 +302,11 @@ async fn get_deployment(
296
302
}
297
303
}
298
304
305
+ #[ instrument( skip_all, fields( %project_name, %deployment_id) ) ]
299
306
async fn delete_deployment (
300
307
Extension ( deployment_manager) : Extension < DeploymentManager > ,
301
308
Extension ( persistence) : Extension < Persistence > ,
302
- Path ( ( _project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
309
+ Path ( ( project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
303
310
) -> Result < Json < shuttle_common:: models:: deployment:: Response > > {
304
311
if let Some ( deployment) = persistence. get_deployment ( & deployment_id) . await ? {
305
312
deployment_manager. kill ( deployment. id ) . await ;
@@ -310,9 +317,10 @@ async fn delete_deployment(
310
317
}
311
318
}
312
319
320
+ #[ instrument( skip_all, fields( %project_name, %deployment_id) ) ]
313
321
async fn get_logs (
314
322
Extension ( persistence) : Extension < Persistence > ,
315
- Path ( ( _project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
323
+ Path ( ( project_name , deployment_id) ) : Path < ( String , Uuid ) > ,
316
324
) -> Result < Json < Vec < LogItem > > > {
317
325
if let Some ( deployment) = persistence. get_deployment ( & deployment_id) . await ? {
318
326
Ok ( Json (
@@ -389,9 +397,10 @@ async fn logs_websocket_handler(mut s: WebSocket, persistence: Persistence, id:
389
397
let _ = s. close ( ) . await ;
390
398
}
391
399
400
+ #[ instrument( skip_all, fields( %project_name, %service_name) ) ]
392
401
async fn get_secrets (
393
402
Extension ( persistence) : Extension < Persistence > ,
394
- Path ( ( _project_name , service_name) ) : Path < ( String , String ) > ,
403
+ Path ( ( project_name , service_name) ) : Path < ( String , String ) > ,
395
404
) -> Result < Json < Vec < secret:: Response > > > {
396
405
if let Some ( service) = persistence. get_service_by_name ( & service_name) . await ? {
397
406
let keys = persistence
0 commit comments