pub struct TracingContext { /* private fields */ }Expand description
High-level tracing context for LangGraph applications.
Bundles store, event bus, and observer into a single convenient API.
Use with #[derive(Traceable)] on your state struct for automatic setup.
Implementations§
Source§impl TracingContext
impl TracingContext
Sourcepub fn observer(&mut self) -> &mut TracingGraphObserver
pub fn observer(&mut self) -> &mut TracingGraphObserver
Access the underlying observer for low-level tracing operations.
Sourcepub fn store(&self) -> &Arc<InMemoryTracingStore>
pub fn store(&self) -> &Arc<InMemoryTracingStore>
Access the underlying store.
Sourcepub fn start_server(&self, addr: &str)
pub fn start_server(&self, addr: &str)
Start the tracing web server in a background task.
Sourcepub async fn run_with_tracing<F, Fut>(
&mut self,
name: &str,
input: JsonValue,
base_config: RunnableConfig,
f: F,
) -> JsonValue
pub async fn run_with_tracing<F, Fut>( &mut self, name: &str, input: JsonValue, base_config: RunnableConfig, f: F, ) -> JsonValue
Run a graph with automatic tracing.
The closure receives a RunnableConfig (with trace_id injected into
configurable) and should execute the graph, returning the output.
on_graph_start and on_graph_end are called automatically.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TracingContext
impl !UnwindSafe for TracingContext
impl Freeze for TracingContext
impl Send for TracingContext
impl Sync for TracingContext
impl Unpin for TracingContext
impl UnsafeUnpin for TracingContext
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
Mutably borrows from an owned value. Read more