tweak tracing spans; inlines

db deserializer tracing instrument cover

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-02 05:30:51 +00:00
parent 685b127f99
commit 02f19cf951
16 changed files with 146 additions and 34 deletions

View file

@ -15,8 +15,12 @@ use ruma::{
use super::check_room_id;
#[implement(super::Service)]
#[tracing::instrument(
level = "warn",
skip_all,
fields(%origin),
)]
#[allow(clippy::type_complexity)]
#[tracing::instrument(skip_all)]
pub(super) async fn fetch_prev(
&self,
origin: &ServerName,

View file

@ -1,6 +1,6 @@
use std::collections::{hash_map, HashMap};
use conduwuit::{debug, implement, warn, Err, Error, PduEvent, Result};
use conduwuit::{debug, debug_warn, implement, Err, Error, PduEvent, Result};
use futures::FutureExt;
use ruma::{
api::federation::event::get_room_state_ids, events::StateEventType, EventId, OwnedEventId,
@ -13,7 +13,11 @@ use crate::rooms::short::ShortStateKey;
/// server's response to some extend (sic), but we still do a lot of checks
/// on the events
#[implement(super::Service)]
#[tracing::instrument(skip(self, create_event, room_version_id))]
#[tracing::instrument(
level = "warn",
skip_all,
fields(%origin),
)]
pub(super) async fn fetch_state(
&self,
origin: &ServerName,
@ -22,7 +26,6 @@ pub(super) async fn fetch_state(
room_version_id: &RoomVersionId,
event_id: &EventId,
) -> Result<Option<HashMap<u64, OwnedEventId>>> {
debug!("Fetching state ids");
let res = self
.services
.sending
@ -31,7 +34,7 @@ pub(super) async fn fetch_state(
event_id: event_id.to_owned(),
})
.await
.inspect_err(|e| warn!("Fetching state for event failed: {e}"))?;
.inspect_err(|e| debug_warn!("Fetching state for event failed: {e}"))?;
debug!("Fetching state events");
let state_vec = self

View file

@ -39,7 +39,12 @@ use crate::rooms::timeline::RawPduId;
/// 14. Check if the event passes auth based on the "current state" of the room,
/// if not soft fail it
#[implement(super::Service)]
#[tracing::instrument(skip(self, origin, value, is_timeline_event), name = "pdu")]
#[tracing::instrument(
name = "pdu",
level = "warn",
skip_all,
fields(%room_id, %event_id),
)]
pub async fn handle_incoming_pdu<'a>(
&self,
origin: &'a ServerName,

View file

@ -13,8 +13,10 @@ use ruma::{CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName};
#[allow(clippy::type_complexity)]
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(
skip(self, origin, event_id, room_id, eventid_info, create_event, first_pdu_in_room),
name = "prev"
name = "prev",
level = "warn",
skip_all,
fields(%prev_id),
)]
pub(super) async fn handle_prev_pdu<'a>(
&self,