MCPcopy Create free account
hub / github.com/AI45Lab/Code / record_tool_result

Function record_tool_result

core/src/telemetry.rs:85–90  ·  view source on GitHub ↗

Record tool execution result on the current span

(exit_code: i32, duration: std::time::Duration)

Source from the content-addressed store, hash-verified

83
84/// Record tool execution result on the current span
85pub 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
93pub struct TimedSpan {

Calls 1

recordMethod · 0.45