You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let resp = client::raw_post(cfg,"/api/unstable/llm-obs-mcp/v1/trace/span-details", body)
408
+
.await
409
+
.map_err(|e| anyhow::anyhow!("failed to get span details: {e:?}"))?;
410
+
formatter::output(cfg,&resp)
411
+
}
412
+
386
413
#[cfg(test)]
387
414
mod tests {
388
415
@@ -1347,7 +1374,7 @@ mod tests {
1347
1374
letmut server = mockito::Server::new_async().await;
1348
1375
let cfg = test_config(&server.url());
1349
1376
1350
-
let body = r#"{"status":"success","data":{"spans":[{"span_id":"s-1","trace_id":"t-1","name":"llm-call","span_kind":"llm","ml_app":"my-app","status":"ok","duration_ms":42.0,"start_ms":1000000,"tags":[]}]}}"#;
1377
+
let body = r#"{"status":"success","data":{"spans":[{"span_id":"s-1","trace_id":"t-1","name":"llm-call","span_kind":"llm","ml_app":"my-app","status":"ok","duration_ms":42.0,"start_ms":1000000,"tags":[],"llm_info":{"model_name":"claude-opus-4-6","model_provider":"anthropic","input_tokens":1024,"output_tokens":256,"total_tokens":1280}}]}}"#;
assert!(result.is_err(),"should fail without auth");
1546
1573
cleanup_env();
1547
1574
}
1575
+
1576
+
#[tokio::test]
1577
+
asyncfntest_llm_obs_spans_details(){
1578
+
let _lock = lock_env().await;
1579
+
letmut server = mockito::Server::new_async().await;
1580
+
let cfg = test_config(&server.url());
1581
+
1582
+
let body = r#"{"status":"success","data":{"spans":[{"span_id":"s-1","trace_id":"t-1","name":"llm-call","kind":"llm","ml_app":"my-app","status":"ok","duration_ms":42.0,"start_ms":1000000,"tags":[],"llm_info":{"model_name":"claude-opus-4-6","model_provider":"anthropic","input_tokens":1024,"output_tokens":256,"total_tokens":1280},"metrics":{"input_tokens":1024,"output_tokens":256,"total_tokens":1280,"non_cached_input_tokens":512,"cache_read_input_tokens":512,"cache_write_input_tokens":0,"estimated_input_cost":3072000,"estimated_output_cost":5120000,"estimated_total_cost":8192000,"estimated_cache_read_input_cost":512000,"estimated_cache_write_input_cost":0,"estimated_non_cached_input_cost":2560000,"estimated_reasoning_output_cost":0,"reasoning_output_tokens":0},"content_info":{}}]}}"#;
0 commit comments