Record tool execution result on the current span
(exit_code: i32, duration: std::time::Duration)
| 83 | |
| 84 | /// Record tool execution result on the current span |
| 85 | pub fn record_tool_result(exit_code: i32, duration: std::time::Duration) { |
| 86 | let span = tracing::Span::current(); |
| 87 | span.record(ATTR_TOOL_EXIT_CODE, exit_code as i64); |
| 88 | span.record(ATTR_TOOL_SUCCESS, exit_code == 0); |
| 89 | span.record(ATTR_TOOL_DURATION_MS, duration.as_millis() as i64); |
| 90 | } |
| 91 | |
| 92 | /// A guard that measures elapsed time and records it when dropped |
| 93 | pub struct TimedSpan { |