1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-24 23:01:05 +03:00

Trace AWS operations & share TLS connector with mas-http

This commit is contained in:
Quentin Gliech
2022-11-03 17:45:49 +01:00
parent b5fd54bbf4
commit a414936484
9 changed files with 125 additions and 50 deletions

View File

@@ -31,3 +31,16 @@ where
span.add_event("exception".to_owned(), attributes);
}
}
#[derive(Debug, Clone, Copy, Default)]
pub struct DebugOnError;
impl<E> OnError<E> for DebugOnError
where
E: std::fmt::Debug,
{
fn on_error(&self, span: &SpanRef<'_>, _metrics_labels: &mut Vec<KeyValue>, err: &E) {
let attributes = vec![EXCEPTION_MESSAGE.string(format!("{err:?}"))];
span.add_event("exception".to_owned(), attributes);
}
}