additional info level span adjustments
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
af399fd517
commit
329925c661
7 changed files with 24 additions and 13 deletions
|
@ -13,7 +13,7 @@ use crate::{Error, Result, Ruma};
|
||||||
/// # `POST /_matrix/federation/v1/publicRooms`
|
/// # `POST /_matrix/federation/v1/publicRooms`
|
||||||
///
|
///
|
||||||
/// Lists the public rooms on this server.
|
/// Lists the public rooms on this server.
|
||||||
#[tracing::instrument(skip_all, fields(%client), name = "publicrooms")]
|
#[tracing::instrument(name = "publicrooms", level = "debug", skip_all, fields(%client))]
|
||||||
pub(crate) async fn get_public_rooms_filtered_route(
|
pub(crate) async fn get_public_rooms_filtered_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
InsecureClientIp(client): InsecureClientIp,
|
InsecureClientIp(client): InsecureClientIp,
|
||||||
|
@ -51,7 +51,7 @@ pub(crate) async fn get_public_rooms_filtered_route(
|
||||||
/// # `GET /_matrix/federation/v1/publicRooms`
|
/// # `GET /_matrix/federation/v1/publicRooms`
|
||||||
///
|
///
|
||||||
/// Lists the public rooms on this server.
|
/// Lists the public rooms on this server.
|
||||||
#[tracing::instrument(skip_all, fields(%client), "publicrooms")]
|
#[tracing::instrument(name = "publicrooms", level = "debug", skip_all, fields(%client))]
|
||||||
pub(crate) async fn get_public_rooms_route(
|
pub(crate) async fn get_public_rooms_route(
|
||||||
State(services): State<crate::State>,
|
State(services): State<crate::State>,
|
||||||
InsecureClientIp(client): InsecureClientIp,
|
InsecureClientIp(client): InsecureClientIp,
|
||||||
|
|
|
@ -3,7 +3,9 @@ use std::{collections::BTreeMap, net::IpAddr, time::Instant};
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum_client_ip::InsecureClientIp;
|
use axum_client_ip::InsecureClientIp;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, debug_warn, err, error,
|
debug,
|
||||||
|
debug::INFO_SPAN_LEVEL,
|
||||||
|
debug_warn, err, error,
|
||||||
result::LogErr,
|
result::LogErr,
|
||||||
trace,
|
trace,
|
||||||
utils::{
|
utils::{
|
||||||
|
@ -49,8 +51,8 @@ type Pdu = (OwnedRoomId, OwnedEventId, CanonicalJsonObject);
|
||||||
///
|
///
|
||||||
/// Push EDUs and PDUs to this server.
|
/// Push EDUs and PDUs to this server.
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
name = "send",
|
name = "txn",
|
||||||
level = "debug",
|
level = INFO_SPAN_LEVEL,
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(
|
fields(
|
||||||
%client,
|
%client,
|
||||||
|
|
|
@ -4,6 +4,7 @@ use std::{any::Any, panic};
|
||||||
|
|
||||||
// Export debug proc_macros
|
// Export debug proc_macros
|
||||||
pub use conduwuit_macros::recursion_depth;
|
pub use conduwuit_macros::recursion_depth;
|
||||||
|
use tracing::Level;
|
||||||
|
|
||||||
// Export all of the ancillary tools from here as well.
|
// Export all of the ancillary tools from here as well.
|
||||||
pub use crate::{result::DebugInspect, utils::debug::*};
|
pub use crate::{result::DebugInspect, utils::debug::*};
|
||||||
|
@ -51,6 +52,12 @@ macro_rules! debug_info {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const INFO_SPAN_LEVEL: Level = if cfg!(debug_assertions) {
|
||||||
|
Level::INFO
|
||||||
|
} else {
|
||||||
|
Level::DEBUG
|
||||||
|
};
|
||||||
|
|
||||||
pub fn set_panic_trap() {
|
pub fn set_panic_trap() {
|
||||||
let next = panic::take_hook();
|
let next = panic::take_hook();
|
||||||
panic::set_hook(Box::new(move |info| {
|
panic::set_hook(Box::new(move |info| {
|
||||||
|
|
|
@ -2,8 +2,8 @@ use std::{fmt::Debug, mem};
|
||||||
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, debug_error, debug_warn, err, error::inspect_debug_log, implement, trace,
|
debug, debug::INFO_SPAN_LEVEL, debug_error, debug_warn, err, error::inspect_debug_log,
|
||||||
utils::string::EMPTY, Err, Error, Result,
|
implement, trace, utils::string::EMPTY, Err, Error, Result,
|
||||||
};
|
};
|
||||||
use http::{header::AUTHORIZATION, HeaderValue};
|
use http::{header::AUTHORIZATION, HeaderValue};
|
||||||
use ipaddress::IPAddress;
|
use ipaddress::IPAddress;
|
||||||
|
@ -48,7 +48,8 @@ where
|
||||||
|
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
level = "debug"
|
name = "fed",
|
||||||
|
level = INFO_SPAN_LEVEL,
|
||||||
skip(self, client, request),
|
skip(self, client, request),
|
||||||
)]
|
)]
|
||||||
pub async fn execute_on<T>(
|
pub async fn execute_on<T>(
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::{
|
||||||
time::Instant,
|
time::Instant,
|
||||||
};
|
};
|
||||||
|
|
||||||
use conduwuit::{debug, err, implement, warn, Err, Result};
|
use conduwuit::{debug, debug::INFO_SPAN_LEVEL, err, implement, warn, Err, Result};
|
||||||
use futures::{
|
use futures::{
|
||||||
future::{try_join5, OptionFuture},
|
future::{try_join5, OptionFuture},
|
||||||
FutureExt,
|
FutureExt,
|
||||||
|
@ -42,7 +42,7 @@ use crate::rooms::timeline::RawPduId;
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
name = "pdu",
|
name = "pdu",
|
||||||
level = "debug",
|
level = INFO_SPAN_LEVEL,
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(%room_id, %event_id),
|
fields(%room_id, %event_id),
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -5,7 +5,8 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, implement, utils::continue_exponential_backoff_secs, Err, PduEvent, Result,
|
debug, debug::INFO_SPAN_LEVEL, implement, utils::continue_exponential_backoff_secs, Err,
|
||||||
|
PduEvent, Result,
|
||||||
};
|
};
|
||||||
use ruma::{CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName, UInt};
|
use ruma::{CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName, UInt};
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ use ruma::{CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName, UInt};
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
name = "prev",
|
name = "prev",
|
||||||
level = "debug",
|
level = INFO_SPAN_LEVEL,
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(%prev_id),
|
fields(%prev_id),
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -268,7 +268,7 @@ impl Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the summary of a space using solely federation
|
/// Gets the summary of a space using solely federation
|
||||||
#[tracing::instrument(skip(self))]
|
#[tracing::instrument(level = "debug", skip(self))]
|
||||||
async fn get_summary_and_children_federation(
|
async fn get_summary_and_children_federation(
|
||||||
&self,
|
&self,
|
||||||
current_room: &OwnedRoomId,
|
current_room: &OwnedRoomId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue