This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic telemetry - tracing * Update to tracing with requests id
- Loading branch information
1 parent
95b68ff
commit 731187a
Showing
5 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use axum::http; | ||
use uuid::Uuid; | ||
|
||
#[derive(Clone)] | ||
pub struct RequestSpan; | ||
|
||
impl<B> tower_http::trace::MakeSpan<B> for RequestSpan { | ||
fn make_span(&mut self, request: &http::Request<B>) -> tracing::Span { | ||
tracing::error_span!( | ||
"rq", | ||
id = %Uuid::new_v4().to_string(), | ||
method = %request.method(), | ||
uri = %request.uri(), | ||
version = ?request.version(), | ||
) | ||
} | ||
} |