aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-vcs/src/driver/github.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 23:52:13 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 23:52:13 +0900
commit2622fa3089d1df249276083d157e43b080a59100 (patch)
tree43bc31546fd3c81e13e5385cbf5cac493e045691 /crates/mozart-vcs/src/driver/github.rs
parentd6e0c6d34449224ac3687daf551a0acfd15cee32 (diff)
downloadphp-mozart-2622fa3089d1df249276083d157e43b080a59100.tar.gz
php-mozart-2622fa3089d1df249276083d157e43b080a59100.tar.zst
php-mozart-2622fa3089d1df249276083d157e43b080a59100.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-vcs/src/driver/github.rs')
-rw-r--r--crates/mozart-vcs/src/driver/github.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/mozart-vcs/src/driver/github.rs b/crates/mozart-vcs/src/driver/github.rs
index 724cb35..c47c2fe 100644
--- a/crates/mozart-vcs/src/driver/github.rs
+++ b/crates/mozart-vcs/src/driver/github.rs
@@ -65,6 +65,7 @@ impl GitHubDriver {
)
}
+ #[tracing::instrument(skip(self))]
async fn api_get(&self, path: &str) -> Result<serde_json::Value> {
let url = self.api_url(path);
let mut req = self
@@ -78,6 +79,7 @@ impl GitHubDriver {
}
let response = req.send().await?;
+ tracing::debug!(status = %response.status(), %url, "GitHub API response");
if !response.status().is_success() {
bail!(
"GitHub API request to {} failed with status {}",
@@ -88,6 +90,7 @@ impl GitHubDriver {
Ok(response.json().await?)
}
+ #[tracing::instrument(skip(self))]
async fn api_get_paginated(&self, path: &str) -> Result<Vec<serde_json::Value>> {
let mut items = Vec::new();
let mut page = 1;
@@ -107,6 +110,7 @@ impl GitHubDriver {
}
let response = req.send().await?;
+ tracing::debug!(status = %response.status(), %url, "GitHub API paginated response");
if !response.status().is_success() {
bail!("GitHub API paginated request failed: {}", response.status());
}