Skip to main content

TraceContextProvider

Trait TraceContextProvider 

Source
pub trait TraceContextProvider:
    Send
    + Sync
    + 'static {
    // Required method
    fn get_trace_context<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = TraceContext> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Async provider that returns the current TraceContext for outbound session RPCs.

Set via ClientOptions::on_get_trace_context. The SDK invokes get_trace_context before each session.create, session.resume, and session.send whenever the call site does not carry a per-turn override.

Implementations should handle errors internally and return TraceContext::default() to skip injection — no Result return type is exposed because trace propagation is a best-effort observability feature, not a correctness-critical RPC parameter.

Required Methods§

Source

fn get_trace_context<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = TraceContext> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the current trace context, or TraceContext::default() to skip injection.

Implementors§