Tracing: migrate spans from raw OTel SDK to tracing + tracing-opentelemetry (#135) #148

Merged
cameron merged 8 commits from feature/tracing-migration into master 2026-09-29 21:52:02 +00:00
2 changed files with 13 additions and 4 deletions
Showing only changes of commit f510940819 - Show all commits

No files matched your search

+12 -4
View File
@@ -503,7 +503,8 @@ pub async fn generate_insight_handler(
let path_for_task = path.clone();
let generator_for_task = generator.clone();
let result = tokio::task::spawn(async move {
let result = tokio::task::spawn(
async move {
// Cross-model barrier: if a TTS synthesis holds the GPU, wait it
// out BEFORE the generation wall-clock starts. The per-request
// lease keeps reqwest budgets honest, but this job-level timeout
@@ -525,7 +526,10 @@ pub async fn generate_insight_handler(
),
)
.await
})
}
// Inner panic-isolation task: carry the job span in too.
.instrument(tracing::Span::current()),
)
.await;
let mut dao = job_dao.lock().expect("Unable to lock InsightJobDao");
@@ -883,7 +887,8 @@ pub async fn generate_agentic_insight_handler(
let path_for_task = path.clone();
let generator_for_task = generator.clone();
let result = tokio::task::spawn(async move {
let result = tokio::task::spawn(
async move {
// Cross-model barrier — see generate_insight_handler: wait out any
// running TTS synthesis before the generation wall-clock starts.
drop(crate::ai::gpu::llm_lease().await);
@@ -908,7 +913,10 @@ pub async fn generate_agentic_insight_handler(
),
)
.await
})
}
// Inner panic-isolation task: carry the job span in too.
.instrument(tracing::Span::current()),
)
.await;
let mut dao = job_dao.lock().expect("Unable to lock InsightJobDao");
+1
View File
@@ -394,6 +394,7 @@ pub fn watch_files(
// Disabled libraries skip the probe entirely — they should
// never enter the health map (treated as out-of-scope).
{
let _probe = tracing::info_span!("watcher.initial_probe").entered();
let libs = libs_lock.read().unwrap_or_else(|e| e.into_inner());
for lib in libs.iter() {
if !lib.enabled {