pub struct TracingCollector { /* private fields */ }Implementations§
Source§impl TracingCollector
impl TracingCollector
Sourcepub fn new(
output_dir: &Path,
service_name: impl Into<String>,
redact: bool,
trace_tx: Option<UnboundedSender<TraceEvent>>,
) -> Result<Self>
pub fn new( output_dir: &Path, service_name: impl Into<String>, redact: bool, trace_tx: Option<UnboundedSender<TraceEvent>>, ) -> Result<Self>
Sourcepub fn begin_iteration(&mut self, index: usize, user_msg_preview: &str)
pub fn begin_iteration(&mut self, index: usize, user_msg_preview: &str)
Open an iteration span. Call at the start of process_user_message.
Sourcepub fn end_iteration(&mut self, index: usize, status: SpanStatus)
pub fn end_iteration(&mut self, index: usize, status: SpanStatus)
Close an iteration span.
Sourcepub fn begin_llm_request(&self, iteration_span_id: [u8; 8]) -> SpanGuard
pub fn begin_llm_request(&self, iteration_span_id: [u8; 8]) -> SpanGuard
Open an LLM request span. Returns an owned SpanGuard safe to hold across .await.
Sourcepub fn end_llm_request(&mut self, guard: SpanGuard, attrs: &LlmAttributes)
pub fn end_llm_request(&mut self, guard: SpanGuard, attrs: &LlmAttributes)
Close an LLM request span.
Sourcepub fn begin_tool_call(
&self,
tool_name: &str,
iteration_span_id: [u8; 8],
) -> SpanGuard
pub fn begin_tool_call( &self, tool_name: &str, iteration_span_id: [u8; 8], ) -> SpanGuard
Open a tool call span, recording the start time as now.
Sourcepub fn begin_tool_call_at(
&self,
tool_name: &str,
iteration_span_id: [u8; 8],
started_at: &Instant,
) -> SpanGuard
pub fn begin_tool_call_at( &self, tool_name: &str, iteration_span_id: [u8; 8], started_at: &Instant, ) -> SpanGuard
Open a tool call span with a pre-recorded start time.
Use this variant when the tool has already executed (post-hoc assembly pattern) and
started_at was captured before the call. The Unix start timestamp is back-computed
from started_at.elapsed() so the span is correctly positioned on the timeline.
Sourcepub fn end_tool_call(
&mut self,
guard: SpanGuard,
tool_name: &str,
attrs: ToolAttributes,
)
pub fn end_tool_call( &mut self, guard: SpanGuard, tool_name: &str, attrs: ToolAttributes, )
Close a tool call span.
Sourcepub fn begin_memory_search(&self, parent_span_id: [u8; 8]) -> SpanGuard
pub fn begin_memory_search(&self, parent_span_id: [u8; 8]) -> SpanGuard
Open a memory search span.
Sourcepub fn end_memory_search(
&mut self,
guard: SpanGuard,
attrs: &MemorySearchAttributes,
)
pub fn end_memory_search( &mut self, guard: SpanGuard, attrs: &MemorySearchAttributes, )
Close a memory search span.
Sourcepub fn trace_json_path(&self) -> PathBuf
pub fn trace_json_path(&self) -> PathBuf
Return the path to the trace.json file that will be written on finish().
Sourcepub fn current_iteration_span_id(&self, index: usize) -> Option<[u8; 8]>
pub fn current_iteration_span_id(&self, index: usize) -> Option<[u8; 8]>
Return the span ID of the currently active iteration, if any.
Sourcepub fn session_span_id(&self) -> [u8; 8]
pub fn session_span_id(&self) -> [u8; 8]
Return the session root span ID (fallback parent when no iteration is active).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TracingCollector
impl RefUnwindSafe for TracingCollector
impl Send for TracingCollector
impl Sync for TracingCollector
impl Unpin for TracingCollector
impl UnsafeUnpin for TracingCollector
impl UnwindSafe for TracingCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request