pub struct TracingCfg {
pub enabled: bool,
pub endpoint: String,
pub sample_rate: f64,
pub service_name: String,
pub batch: usize,
pub interval_secs: u64,
pub queue_size: usize,
pub timeout_ms: u64,
}Expand description
[tracing] — one OpenTelemetry SERVER span per proxied request.
Distinct from [llm.telemetry], which emits a CLIENT span only for metered LLM requests. That
covers the gateway deployment and leaves a plain reverse-proxy install — most of them — emitting
no traces at all. This is the general one.
Off by default. When on, spans are batched to any OTLP/HTTP /v1/traces receiver over the
crate’s existing HTTP client: no OpenTelemetry SDK, no protobuf, still one static binary.
The request path never waits on it. A span is handed to a bounded queue and a background task does the rest, so a slow or absent collector costs dropped spans rather than latency.
Fields§
§enabled: bool§endpoint: StringOTLP/HTTP traces endpoint, e.g. http://otel-collector:4318/v1/traces. Empty disables
tracing regardless of enabled — an endpoint-less “enabled” would mint trace ids on every
request and throw them away.
sample_rate: f64Fraction of traces to record, 0.0–1.0. Deterministic per trace id, so a trace is wholly
sampled or wholly not — a half-recorded trace is worse than none, because the gap looks like
a missing service.
service_name: Stringservice.name on emitted spans.
batch: usizeSpans per POST.
interval_secs: u64Flush a partial batch after this many seconds.
queue_size: usizeIn-memory queue between the request path and the shipper. Past it, spans are dropped rather than the request path blocking.
timeout_ms: u64Per-POST timeout in milliseconds.
Trait Implementations§
Source§impl Clone for TracingCfg
impl Clone for TracingCfg
Source§fn clone(&self) -> TracingCfg
fn clone(&self) -> TracingCfg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more