pub struct TelemetryRuntime {
pub enabled: bool,
pub capture_content: bool,
pub max_content_bytes: usize,
/* private fields */
}Expand description
The compiled telemetry runtime carried on the proxy Runtime.
Fields§
§enabled: bool§capture_content: boolWhether to attach captured prompt/response content (populated at the wiring site).
max_content_bytes: usizeImplementations§
Source§impl TelemetryRuntime
impl TelemetryRuntime
Sourcepub fn build(cfg: &TelemetryCfg) -> Self
pub fn build(cfg: &TelemetryCfg) -> Self
Compile from config. enabled folds in “has a non-empty endpoint” so a misconfigured switch
(on, but no endpoint) is inert rather than erroring on every request.
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
An inert runtime (emission off) — the default when [llm.telemetry] is absent.
Sourcepub fn emit(&self, record: SpanRecord)
pub fn emit(&self, record: SpanRecord)
Fire-and-forget: build the OTLP-JSON and POST it on a background task. Never blocks, and any error (endpoint down, non-2xx) is swallowed at debug level — telemetry must not affect traffic.
Trait Implementations§
Source§impl Clone for TelemetryRuntime
impl Clone for TelemetryRuntime
Source§fn clone(&self) -> TelemetryRuntime
fn clone(&self) -> TelemetryRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TelemetryRuntime
impl !UnwindSafe for TelemetryRuntime
impl Freeze for TelemetryRuntime
impl Send for TelemetryRuntime
impl Sync for TelemetryRuntime
impl Unpin for TelemetryRuntime
impl UnsafeUnpin for TelemetryRuntime
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