pub struct TraceWriter { /* private fields */ }Expand description
Append-only writer used by hot-path Codex instrumentation. Local trace bundle writer.
The writer appends raw events and writes payload files. It does not keep a
reduced RolloutTrace in memory; replay is owned by the reducer.
Implementations§
Source§impl TraceWriter
impl TraceWriter
Sourcepub fn create(
bundle_dir: impl AsRef<Path>,
trace_id: String,
rollout_id: String,
root_thread_id: AgentThreadId,
) -> Result<Self>
pub fn create( bundle_dir: impl AsRef<Path>, trace_id: String, rollout_id: String, root_thread_id: AgentThreadId, ) -> Result<Self>
Creates a trace bundle directory and writes its manifest.
Sourcepub fn write_json_payload(
&self,
kind: RawPayloadKind,
value: &impl Serialize,
) -> Result<RawPayloadRef>
pub fn write_json_payload( &self, kind: RawPayloadKind, value: &impl Serialize, ) -> Result<RawPayloadRef>
Writes a JSON payload file and returns its reduced-state reference.
Sourcepub fn append(&self, payload: RawTraceEventPayload) -> Result<RawTraceEvent>
pub fn append(&self, payload: RawTraceEventPayload) -> Result<RawTraceEvent>
Appends one raw event with no extra envelope context.
Sourcepub fn append_with_context(
&self,
context: RawTraceEventContext,
payload: RawTraceEventPayload,
) -> Result<RawTraceEvent>
pub fn append_with_context( &self, context: RawTraceEventContext, payload: RawTraceEventPayload, ) -> Result<RawTraceEvent>
Appends one raw event with explicit thread/turn context.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TraceWriter
impl RefUnwindSafe for TraceWriter
impl Send for TraceWriter
impl Sync for TraceWriter
impl Unpin for TraceWriter
impl UnsafeUnpin for TraceWriter
impl UnwindSafe for TraceWriter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
Converts
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>
Converts
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 more