diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-02 12:16:29 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-02 12:16:29 -0600 |
| commit | bc673b0de36342ef4fca8d0ae4f8bd029b4054b8 (patch) | |
| tree | bd5d1a7048b555d4fcb8609ab42b88a7b6e977cd | |
| parent | 6e25870046586fea54ba74ae1e673d2ad22eaeae (diff) | |
chore: request method, path and headers in tracing
| -rw-r--r-- | src/authorization/server.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/authorization/server.rs b/src/authorization/server.rs index 6ae9361f..da686350 100644 --- a/src/authorization/server.rs +++ b/src/authorization/server.rs @@ -24,8 +24,16 @@ impl Server { where F: FnOnce(tonic::transport::Server) -> tonic::transport::server::Router, { - let builder = - tonic::transport::Server::builder().timeout(std::time::Duration::from_secs(30)); + let builder = tonic::transport::Server::builder() + .trace_fn(|req| { + tracing::info_span!( + "grpc_request", + method = %req.method(), + path = %req.uri().path(), + headers = ?req.headers(), + ) + }) + .timeout(std::time::Duration::from_secs(30)); let router = f(builder); Server { router } } |
