-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO-ISSUE] fix/adapt logging tracing healthcheck (#39)
* refactor: change url of healthcheck * refactor(tracing): add global error handler and set healthcheck as DEBUG * fix: url in JS client
- Loading branch information
1 parent
f95161e
commit a7c00c9
Showing
6 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
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,25 @@ | ||
use actix_web::{ | ||
body::MessageBody, | ||
dev::{ServiceRequest, ServiceResponse}, | ||
Error, | ||
}; | ||
use tracing::{Level, Span}; | ||
use tracing_actix_web::{DefaultRootSpanBuilder, RootSpanBuilder}; | ||
|
||
pub struct NitteiTracingRootSpanBuilder; | ||
|
||
impl RootSpanBuilder for NitteiTracingRootSpanBuilder { | ||
fn on_request_start(request: &ServiceRequest) -> Span { | ||
// Ignore healthcheck endpoint | ||
let level = if request.path() == "/api/v1/healthcheck" { | ||
Level::DEBUG | ||
} else { | ||
Level::INFO | ||
}; | ||
tracing_actix_web::root_span!(level = level, request) | ||
} | ||
|
||
fn on_request_end<B: MessageBody>(span: Span, outcome: &Result<ServiceResponse<B>, Error>) { | ||
DefaultRootSpanBuilder::on_request_end(span, outcome); | ||
} | ||
} |
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