From 2622fa3089d1df249276083d157e43b080a59100 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 23 Feb 2026 23:52:13 +0900 Subject: feat(tracing): instrument network requests with tracing spans Add #[tracing::instrument] and debug logs to all HTTP-calling functions in mozart-registry and mozart-vcs for request-level observability (URL, status code, cache hits, download size). Co-Authored-By: Claude Opus 4.6 --- crates/mozart-vcs/src/driver/forgejo.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/mozart-vcs/src/driver/forgejo.rs') diff --git a/crates/mozart-vcs/src/driver/forgejo.rs b/crates/mozart-vcs/src/driver/forgejo.rs index 0447422..ec2ca14 100644 --- a/crates/mozart-vcs/src/driver/forgejo.rs +++ b/crates/mozart-vcs/src/driver/forgejo.rs @@ -76,6 +76,7 @@ impl ForgejoDriver { ) } + #[tracing::instrument(skip(self))] async fn api_get(&self, path: &str) -> Result { let url = self.api_url(path); let mut req = self @@ -87,6 +88,7 @@ impl ForgejoDriver { req = req.header(AUTHORIZATION, format!("token {token}")); } let response = req.send().await?; + tracing::debug!(status = %response.status(), %url, "Forgejo API response"); if !response.status().is_success() { bail!( "Forgejo API request to {} failed: {}", @@ -97,6 +99,7 @@ impl ForgejoDriver { Ok(response.json().await?) } + #[tracing::instrument(skip(self))] async fn api_get_paginated(&self, path: &str) -> Result> { let mut items = Vec::new(); let mut page = 1; -- cgit v1.3.1