truncate other span names and fields

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-17 06:32:53 +00:00
parent 5f46623371
commit 7eee88160a
2 changed files with 5 additions and 10 deletions

View file

@ -8,7 +8,7 @@ use data::Data;
use ruma::{api::client::error::ErrorKind, EventId, RoomId};
use tracing::{debug, error, trace, warn};
use crate::{services, utils::debug_slice_truncated, Error, Result};
use crate::{services, Error, Result};
pub struct Service {
pub db: Arc<dyn Data>,
@ -30,7 +30,7 @@ impl Service {
.filter_map(move |sid| services().rooms.short.get_eventid_from_short(sid).ok()))
}
#[tracing::instrument(skip(self), fields(starting_events = debug_slice_truncated(starting_events, 5)))]
#[tracing::instrument(skip_all, name = "auth_chain")]
pub async fn get_auth_chain(&self, room_id: &RoomId, starting_events: &[&EventId]) -> Result<Vec<u64>> {
const NUM_BUCKETS: usize = 50; //TODO: change possible w/o disrupting db?
const BUCKET: BTreeSet<(u64, &EventId)> = BTreeSet::new();

View file

@ -541,7 +541,7 @@ async fn send_events_dest_push(
#[tracing::instrument(skip(dest, events), name = "")]
async fn send_events_dest_normal(
dest: &Destination, server_name: &OwnedServerName, events: Vec<SendingEvent>,
dest: &Destination, server: &OwnedServerName, events: Vec<SendingEvent>,
) -> SendingResult {
let mut edu_jsons = Vec::new();
let mut pdu_jsons = Vec::new();
@ -557,12 +557,7 @@ async fn send_events_dest_normal(
.get_pdu_json_from_id(pdu_id)
.map_err(|e| (dest.clone(), e))?
.ok_or_else(|| {
error!(
dest = ?dest,
server_name = ?server_name,
pdu_id = ?pdu_id,
"event not found"
);
error!(?dest, ?server, ?pdu_id, "event not found");
(
dest.clone(),
Error::bad_database("[Normal] Event in servernameevent_data not found in db."),
@ -587,7 +582,7 @@ async fn send_events_dest_normal(
// transaction");
send::send(
client,
server_name,
server,
send_transaction_message::v1::Request {
origin: services().globals.server_name().to_owned(),
pdus: pdu_jsons,