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/bitbucket.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/mozart-vcs/src/driver/bitbucket.rs') diff --git a/crates/mozart-vcs/src/driver/bitbucket.rs b/crates/mozart-vcs/src/driver/bitbucket.rs index dc7d2cf..d47987d 100644 --- a/crates/mozart-vcs/src/driver/bitbucket.rs +++ b/crates/mozart-vcs/src/driver/bitbucket.rs @@ -62,6 +62,7 @@ impl BitbucketDriver { ) } + #[tracing::instrument(skip(self))] async fn api_get(&self, path: &str) -> Result { let url = self.api_url(path); let mut req = self @@ -76,6 +77,7 @@ impl BitbucketDriver { } let response = req.send().await?; + tracing::debug!(status = %response.status(), %url, "Bitbucket API response"); if !response.status().is_success() { bail!( "Bitbucket API request to {} failed: {}", @@ -86,6 +88,7 @@ impl BitbucketDriver { Ok(response.json().await?) } + #[tracing::instrument(skip(self))] async fn api_get_paginated(&self, path: &str) -> Result> { let mut items = Vec::new(); let mut next_url = Some(self.api_url(path)); @@ -101,6 +104,7 @@ impl BitbucketDriver { req = req.header(AUTHORIZATION, format!("Basic {key}:{secret}")); } let response = req.send().await?; + tracing::debug!(status = %response.status(), %url, "Bitbucket API paginated response"); if !response.status().is_success() { break; } -- cgit v1.3.1