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]]
name = "ruma"
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 = [
"assign",
"js_int",
@ -3210,7 +3210,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
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 = [
"js_int",
"ruma-common",
@ -3222,7 +3222,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
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 = [
"as_variant",
"assign",
@ -3245,7 +3245,7 @@ dependencies = [
[[package]]
name = "ruma-common"
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 = [
"as_variant",
"base64 0.22.1",
@ -3276,7 +3276,7 @@ dependencies = [
[[package]]
name = "ruma-events"
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 = [
"as_variant",
"indexmap 2.7.0",
@ -3301,7 +3301,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
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 = [
"bytes",
"http",
@ -3319,7 +3319,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
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 = [
"js_int",
"thiserror 2.0.11",
@ -3328,7 +3328,7 @@ dependencies = [
[[package]]
name = "ruma-identity-service-api"
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 = [
"js_int",
"ruma-common",
@ -3338,7 +3338,7 @@ dependencies = [
[[package]]
name = "ruma-macros"
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 = [
"cfg-if",
"proc-macro-crate",
@ -3353,7 +3353,7 @@ dependencies = [
[[package]]
name = "ruma-push-gateway-api"
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 = [
"js_int",
"ruma-common",
@ -3365,7 +3365,7 @@ dependencies = [
[[package]]
name = "ruma-server-util"
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 = [
"headers",
"http",
@ -3378,7 +3378,7 @@ dependencies = [
[[package]]
name = "ruma-signatures"
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 = [
"base64 0.22.1",
"ed25519-dalek",
@ -3394,7 +3394,7 @@ dependencies = [
[[package]]
name = "ruma-state-res"
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 = [
"futures-util",
"js_int",

View file

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

View file

@ -50,7 +50,7 @@ pub(crate) async fn get_media_config_legacy_legacy_route(
/// # `GET /_matrix/media/v3/preview_url`
///
/// 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(
State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp,
@ -131,7 +131,7 @@ pub(crate) async fn create_content_legacy_route(
/// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// 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(
State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp,
@ -197,7 +197,7 @@ pub(crate) async fn get_content_legacy_route(
/// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// 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(
State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp,
@ -216,7 +216,7 @@ pub(crate) async fn get_content_legacy_legacy_route(
/// - Only redirects if `allow_redirect` is true
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// 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(
State(services): State<crate::State>,
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
/// - Uses client-provided `timeout_ms` if available, else defaults to 20
/// 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(
State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp,

View file

@ -14,7 +14,12 @@ use crate::Ruma;
/// # `GET /_matrix/federation/v1/media/download/{mediaId}`
///
/// 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(
State(services): State<crate::State>,
InsecureClientIp(client): InsecureClientIp,
@ -51,7 +56,12 @@ pub(crate) async fn get_content_route(
/// # `GET /_matrix/federation/v1/media/thumbnail/{mediaId}`
///
/// 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(
State(services): State<crate::State>,
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>
/// Numbers in comments below refer to bullet points in linked section of
/// specification
#[tracing::instrument(skip(self, cache), name = "actual")]
#[tracing::instrument(name = "actual", level = "debug", skip(self, cache))]
pub async fn resolve_actual_dest(
&self,
dest: &ServerName,
@ -239,7 +239,7 @@ impl super::Service {
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>> {
self.conditional_query_and_cache(dest, 8448, true).await?;
@ -303,7 +303,7 @@ impl super::Service {
#[inline]
async fn conditional_query_and_cache_override(
&self,
overname: &str,
untername: &str,
hostname: &str,
port: u16,
cache: bool,
@ -312,34 +312,34 @@ impl super::Service {
return Ok(());
}
if self.cache.has_override(overname).await {
if self.cache.has_override(untername).await {
return Ok(());
}
self.query_and_cache_override(overname, hostname, port)
self.query_and_cache_override(untername, hostname, port)
.await
}
#[tracing::instrument(skip(self, overname, port), name = "ip")]
#[tracing::instrument(name = "ip", level = "debug", skip(self))]
async fn query_and_cache_override(
&self,
overname: &'_ str,
untername: &'_ str,
hostname: &'_ str,
port: u16,
) -> Result {
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 {
| Err(e) => Self::handle_resolve_error(&e, hostname),
| Ok(override_ip) => {
self.cache.set_override(overname, &CachedOverride {
self.cache.set_override(untername, &CachedOverride {
ips: override_ip.into_iter().take(MAX_IPS).collect(),
port,
expire: CachedOverride::default_expire(),
overriding: (hostname != overname)
overriding: (hostname != untername)
.then_some(hostname.into())
.inspect(|_| debug_info!("{overname:?} overriden by {hostname:?}")),
.inspect(|_| debug_info!("{untername:?} overriden by {hostname:?}")),
});
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>> {
let hostnames =
[format!("_matrix-fed._tcp.{hostname}."), format!("_matrix._tcp.{hostname}.")];

View file

@ -1017,7 +1017,7 @@ impl Service {
}
/// 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(
&self,
event_id: &EventId,
@ -1053,7 +1053,7 @@ impl Service {
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<()> {
if self
.services