feat: opentelemetry/jaeger support

This commit is contained in:
Timo Kösters 2021-02-28 12:41:03 +01:00
parent 566b8ebabb
commit 4155a47db1
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
45 changed files with 457 additions and 116 deletions

View file

@ -211,6 +211,7 @@ impl Sending {
});
}
#[tracing::instrument(skip(self))]
pub fn send_pdu(&self, server: &ServerName, pdu_id: &[u8]) -> Result<()> {
let mut key = server.as_bytes().to_vec();
key.push(0xff);
@ -220,6 +221,7 @@ impl Sending {
Ok(())
}
#[tracing::instrument(skip(self))]
pub fn send_pdu_appservice(&self, appservice_id: &str, pdu_id: &[u8]) -> Result<()> {
let mut key = "+".as_bytes().to_vec();
key.extend_from_slice(appservice_id.as_bytes());
@ -230,6 +232,7 @@ impl Sending {
Ok(())
}
#[tracing::instrument]
fn calculate_hash(keys: &[IVec]) -> Vec<u8> {
// We only hash the pdu's event ids, not the whole pdu
let bytes = keys.join(&0xff);
@ -237,6 +240,7 @@ impl Sending {
hash.as_ref().to_owned()
}
#[tracing::instrument(skip(globals, rooms, appservice))]
async fn handle_event(
server: Box<ServerName>,
is_appservice: bool,
@ -359,6 +363,7 @@ impl Sending {
))
}
#[tracing::instrument(skip(self, globals))]
pub async fn send_federation_request<T: OutgoingRequest>(
&self,
globals: &crate::database::globals::Globals,
@ -375,6 +380,7 @@ impl Sending {
response
}
#[tracing::instrument(skip(self, globals))]
pub async fn send_appservice_request<T: OutgoingRequest>(
&self,
globals: &crate::database::globals::Globals,