generated from Patagia/template-nix
feat(telemetry): mark error field in spans w/errors
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
This commit is contained in:
parent
86db3cb3a0
commit
ab71064b29
1 changed files with 4 additions and 1 deletions
|
@ -50,8 +50,10 @@ pub fn trace_request(_attr: TokenStream, input: TokenStream) -> TokenStream {
|
|||
let span = tracing::Span::current();
|
||||
span.record("http.status", &status.as_str());
|
||||
if let Err(err) = &result {
|
||||
span.record("error", true);
|
||||
span.record("error.external", &err.external_message);
|
||||
span.record("error.internal", &err.internal_message);
|
||||
|
||||
}
|
||||
|
||||
result
|
||||
|
@ -62,8 +64,9 @@ pub fn trace_request(_attr: TokenStream, input: TokenStream) -> TokenStream {
|
|||
"http.method" = req.method().as_str(),
|
||||
"http.uri" = req.uri().to_string(),
|
||||
"http.status" = tracing::field::Empty,
|
||||
"error" = tracing::field::Empty,
|
||||
"error.external" = tracing::field::Empty,
|
||||
"error.internal" = tracing::field::Empty
|
||||
"error.internal" = tracing::field::Empty,
|
||||
)
|
||||
).await
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue