chore: add tracing to inbox, delivery, actor cache
This commit is contained in:
@@ -35,10 +35,11 @@ pub(crate) async fn check_guards(
|
||||
actor: &Url,
|
||||
data: &Data<FederationData>,
|
||||
) -> Result<bool, Error> {
|
||||
let domain = actor.host_str().unwrap_or("");
|
||||
tracing::info!(activity_id = %id, source_domain = domain, "processing inbound activity");
|
||||
if already_processed(id, data).await {
|
||||
return Ok(true);
|
||||
}
|
||||
let domain = actor.host_str().unwrap_or("");
|
||||
if data.blocklist_repo.is_domain_blocked(domain).await? {
|
||||
tracing::info!(actor = %actor, "ignoring activity from blocked domain");
|
||||
return Ok(true);
|
||||
|
||||
@@ -16,6 +16,11 @@ pub(crate) async fn send_with_retry(
|
||||
max_attempts: u32,
|
||||
initial_delay_secs: u64,
|
||||
) -> Vec<anyhow::Error> {
|
||||
tracing::info!(
|
||||
inbox_count = sends.len(),
|
||||
max_attempts,
|
||||
"starting outbound delivery"
|
||||
);
|
||||
let mut failures = vec![];
|
||||
for send in sends {
|
||||
let mut delay = std::time::Duration::from_secs(initial_delay_secs);
|
||||
|
||||
@@ -43,9 +43,17 @@ impl ActivityPubService {
|
||||
tracing::debug!(actor_url, "fetched_at is None, treating as stale — consider populating fetched_at in get_remote_actor()");
|
||||
false
|
||||
});
|
||||
tracing::debug!(
|
||||
actor_url,
|
||||
cache_hit = true,
|
||||
fresh = is_fresh,
|
||||
"actor cache lookup"
|
||||
);
|
||||
if is_fresh {
|
||||
return Ok(cached);
|
||||
}
|
||||
} else {
|
||||
tracing::debug!(actor_url, cache_hit = false, "actor cache lookup");
|
||||
}
|
||||
let url = match Url::parse(actor_url) {
|
||||
Ok(u) => u,
|
||||
|
||||
Reference in New Issue
Block a user