reduce some tracing span levels; bump ruma

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-23 19:07:13 +00:00
parent b5c167de12
commit 184a3b0f0c
6 changed files with 45 additions and 35 deletions

26
Cargo.lock generated
View file

@ -3188,7 +3188,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma" name = "ruma"
version = "0.10.1" version = "0.10.1"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"assign", "assign",
"js_int", "js_int",
@ -3210,7 +3210,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-appservice-api" name = "ruma-appservice-api"
version = "0.10.0" version = "0.10.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common", "ruma-common",
@ -3222,7 +3222,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-client-api" name = "ruma-client-api"
version = "0.18.0" version = "0.18.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"as_variant", "as_variant",
"assign", "assign",
@ -3245,7 +3245,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-common" name = "ruma-common"
version = "0.13.0" version = "0.13.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"as_variant", "as_variant",
"base64 0.22.1", "base64 0.22.1",
@ -3276,7 +3276,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-events" name = "ruma-events"
version = "0.28.1" version = "0.28.1"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"as_variant", "as_variant",
"indexmap 2.7.0", "indexmap 2.7.0",
@ -3301,7 +3301,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-federation-api" name = "ruma-federation-api"
version = "0.9.0" version = "0.9.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"bytes", "bytes",
"http", "http",
@ -3319,7 +3319,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers-validation" name = "ruma-identifiers-validation"
version = "0.9.5" version = "0.9.5"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"js_int", "js_int",
"thiserror 2.0.11", "thiserror 2.0.11",
@ -3328,7 +3328,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identity-service-api" name = "ruma-identity-service-api"
version = "0.9.0" version = "0.9.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common", "ruma-common",
@ -3338,7 +3338,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-macros" name = "ruma-macros"
version = "0.13.0" version = "0.13.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"proc-macro-crate", "proc-macro-crate",
@ -3353,7 +3353,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-push-gateway-api" name = "ruma-push-gateway-api"
version = "0.9.0" version = "0.9.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common", "ruma-common",
@ -3365,7 +3365,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-server-util" name = "ruma-server-util"
version = "0.3.0" version = "0.3.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"headers", "headers",
"http", "http",
@ -3378,7 +3378,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-signatures" name = "ruma-signatures"
version = "0.15.0" version = "0.15.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"ed25519-dalek", "ed25519-dalek",
@ -3394,7 +3394,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-state-res" name = "ruma-state-res"
version = "0.11.0" version = "0.11.0"
source = "git+https://github.com/girlbossceo/ruwuma?rev=427877d5bc14988ed877e500bbb27f8bc08b84e8#427877d5bc14988ed877e500bbb27f8bc08b84e8" source = "git+https://github.com/girlbossceo/ruwuma?rev=b560338b2a50dbf61ecfe80808b9b095ad4cec00#b560338b2a50dbf61ecfe80808b9b095ad4cec00"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"js_int", "js_int",

View file

@ -332,7 +332,7 @@ version = "0.1.2"
[workspace.dependencies.ruma] [workspace.dependencies.ruma]
git = "https://github.com/girlbossceo/ruwuma" git = "https://github.com/girlbossceo/ruwuma"
#branch = "conduwuit-changes" #branch = "conduwuit-changes"
rev = "427877d5bc14988ed877e500bbb27f8bc08b84e8" rev = "b560338b2a50dbf61ecfe80808b9b095ad4cec00"
features = [ features = [
"compat", "compat",
"rand", "rand",

View file

@ -50,7 +50,7 @@ pub(crate) async fn get_media_config_legacy_legacy_route(
/// # `GET /_matrix/media/v3/preview_url` /// # `GET /_matrix/media/v3/preview_url`
/// ///
/// Returns URL preview. /// Returns URL preview.
#[tracing::instrument(skip_all, fields(%client), name = "url_preview_legacy")] #[tracing::instrument(skip_all, fields(%client), name = "url_preview_legacy", level = "debug")]
pub(crate) async fn get_media_preview_legacy_route( pub(crate) async fn get_media_preview_legacy_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,
@ -131,7 +131,7 @@ pub(crate) async fn create_content_legacy_route(
/// - Only redirects if `allow_redirect` is true /// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20 /// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// seconds /// seconds
#[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy")] #[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy", level = "debug")]
pub(crate) async fn get_content_legacy_route( pub(crate) async fn get_content_legacy_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,
@ -197,7 +197,7 @@ pub(crate) async fn get_content_legacy_route(
/// - Only redirects if `allow_redirect` is true /// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20 /// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// seconds /// seconds
#[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy")] #[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy", level = "debug")]
pub(crate) async fn get_content_legacy_legacy_route( pub(crate) async fn get_content_legacy_legacy_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,
@ -216,7 +216,7 @@ pub(crate) async fn get_content_legacy_legacy_route(
/// - Only redirects if `allow_redirect` is true /// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20 /// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// seconds /// seconds
#[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy")] #[tracing::instrument(skip_all, fields(%client), name = "media_get_legacy", level = "debug")]
pub(crate) async fn get_content_as_filename_legacy_route( pub(crate) async fn get_content_as_filename_legacy_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,
@ -303,7 +303,7 @@ pub(crate) async fn get_content_as_filename_legacy_legacy_route(
/// - Only redirects if `allow_redirect` is true /// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20 /// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// seconds /// seconds
#[tracing::instrument(skip_all, fields(%client), name = "media_thumbnail_get_legacy")] #[tracing::instrument(skip_all, fields(%client), name = "media_thumbnail_get_legacy", level = "debug")]
pub(crate) async fn get_content_thumbnail_legacy_route( pub(crate) async fn get_content_thumbnail_legacy_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,

View file

@ -14,7 +14,12 @@ use crate::Ruma;
/// # `GET /_matrix/federation/v1/media/download/{mediaId}` /// # `GET /_matrix/federation/v1/media/download/{mediaId}`
/// ///
/// Load media from our server. /// Load media from our server.
#[tracing::instrument(skip_all, fields(%client), name = "media_get")] #[tracing::instrument(
name = "media_get",
level = "debug",
skip_all,
fields(%client)
)]
pub(crate) async fn get_content_route( pub(crate) async fn get_content_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,
@ -51,7 +56,12 @@ pub(crate) async fn get_content_route(
/// # `GET /_matrix/federation/v1/media/thumbnail/{mediaId}` /// # `GET /_matrix/federation/v1/media/thumbnail/{mediaId}`
/// ///
/// Load media thumbnail from our server. /// Load media thumbnail from our server.
#[tracing::instrument(skip_all, fields(%client), name = "media_thumbnail_get")] #[tracing::instrument(
name = "media_thumbnail_get",
level = "debug",
skip_all,
fields(%client)
)]
pub(crate) async fn get_content_thumbnail_route( pub(crate) async fn get_content_thumbnail_route(
State(services): State<crate::State>, State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp, InsecureClientIp(client): InsecureClientIp,

View file

@ -58,7 +58,7 @@ impl super::Service {
/// Implemented according to the specification at <https://matrix.org/docs/spec/server_server/r0.1.4#resolving-server-names> /// Implemented according to the specification at <https://matrix.org/docs/spec/server_server/r0.1.4#resolving-server-names>
/// Numbers in comments below refer to bullet points in linked section of /// Numbers in comments below refer to bullet points in linked section of
/// specification /// specification
#[tracing::instrument(skip(self, cache), name = "actual")] #[tracing::instrument(name = "actual", level = "debug", skip(self, cache))]
pub async fn resolve_actual_dest( pub async fn resolve_actual_dest(
&self, &self,
dest: &ServerName, dest: &ServerName,
@ -239,7 +239,7 @@ impl super::Service {
Ok(add_port_to_hostname(dest.as_str())) Ok(add_port_to_hostname(dest.as_str()))
} }
#[tracing::instrument(skip_all, name = "well-known")] #[tracing::instrument(name = "well-known", level = "debug", skip(self, dest))]
async fn request_well_known(&self, dest: &str) -> Result<Option<String>> { async fn request_well_known(&self, dest: &str) -> Result<Option<String>> {
self.conditional_query_and_cache(dest, 8448, true).await?; self.conditional_query_and_cache(dest, 8448, true).await?;
@ -303,7 +303,7 @@ impl super::Service {
#[inline] #[inline]
async fn conditional_query_and_cache_override( async fn conditional_query_and_cache_override(
&self, &self,
overname: &str, untername: &str,
hostname: &str, hostname: &str,
port: u16, port: u16,
cache: bool, cache: bool,
@ -312,34 +312,34 @@ impl super::Service {
return Ok(()); return Ok(());
} }
if self.cache.has_override(overname).await { if self.cache.has_override(untername).await {
return Ok(()); return Ok(());
} }
self.query_and_cache_override(overname, hostname, port) self.query_and_cache_override(untername, hostname, port)
.await .await
} }
#[tracing::instrument(skip(self, overname, port), name = "ip")] #[tracing::instrument(name = "ip", level = "debug", skip(self))]
async fn query_and_cache_override( async fn query_and_cache_override(
&self, &self,
overname: &'_ str, untername: &'_ str,
hostname: &'_ str, hostname: &'_ str,
port: u16, port: u16,
) -> Result { ) -> Result {
self.services.server.check_running()?; self.services.server.check_running()?;
debug!("querying IP for {overname:?} ({hostname:?}:{port})"); debug!("querying IP for {untername:?} ({hostname:?}:{port})");
match self.resolver.resolver.lookup_ip(hostname.to_owned()).await { match self.resolver.resolver.lookup_ip(hostname.to_owned()).await {
| Err(e) => Self::handle_resolve_error(&e, hostname), | Err(e) => Self::handle_resolve_error(&e, hostname),
| Ok(override_ip) => { | Ok(override_ip) => {
self.cache.set_override(overname, &CachedOverride { self.cache.set_override(untername, &CachedOverride {
ips: override_ip.into_iter().take(MAX_IPS).collect(), ips: override_ip.into_iter().take(MAX_IPS).collect(),
port, port,
expire: CachedOverride::default_expire(), expire: CachedOverride::default_expire(),
overriding: (hostname != overname) overriding: (hostname != untername)
.then_some(hostname.into()) .then_some(hostname.into())
.inspect(|_| debug_info!("{overname:?} overriden by {hostname:?}")), .inspect(|_| debug_info!("{untername:?} overriden by {hostname:?}")),
}); });
Ok(()) Ok(())
@ -347,7 +347,7 @@ impl super::Service {
} }
} }
#[tracing::instrument(skip_all, name = "srv")] #[tracing::instrument(name = "srv", level = "debug", skip(self))]
async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> { async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> {
let hostnames = let hostnames =
[format!("_matrix-fed._tcp.{hostname}."), format!("_matrix._tcp.{hostname}.")]; [format!("_matrix-fed._tcp.{hostname}."), format!("_matrix._tcp.{hostname}.")];

View file

@ -1017,7 +1017,7 @@ impl Service {
} }
/// Replace a PDU with the redacted form. /// Replace a PDU with the redacted form.
#[tracing::instrument(skip(self, reason))] #[tracing::instrument(name = "redact", level = "debug", skip(self))]
pub async fn redact_pdu( pub async fn redact_pdu(
&self, &self,
event_id: &EventId, event_id: &EventId,
@ -1053,7 +1053,7 @@ impl Service {
self.replace_pdu(&pdu_id, &obj, &pdu).await self.replace_pdu(&pdu_id, &obj, &pdu).await
} }
#[tracing::instrument(skip(self), level = "debug")] #[tracing::instrument(name = "backfill", level = "debug", skip(self))]
pub async fn backfill_if_required(&self, room_id: &RoomId, from: PduCount) -> Result<()> { pub async fn backfill_if_required(&self, room_id: &RoomId, from: PduCount) -> Result<()> {
if self if self
.services .services