pub struct TelemetryConfig {
pub enabled: bool,
pub backend: TelemetryBackend,
pub trace_dir: PathBuf,
pub include_args: bool,
pub otlp_endpoint: Option<String>,
pub otlp_headers_vault_key: Option<String>,
pub pyroscope_endpoint: Option<String>,
pub service_name: String,
pub sample_rate: f64,
pub system_metrics_interval_secs: u64,
}Expand description
Profiling and distributed tracing configuration, nested under [telemetry] in TOML.
When enabled = true and the binary is compiled with --features profiling, agent turn
phases and LLM provider calls are instrumented with tracing spans. Traces are exported
according to the selected TelemetryBackend.
Enabling telemetry has zero overhead when the profiling feature is absent — all
instrumentation points are compiled out via cfg_attr.
§Example (TOML)
[telemetry]
enabled = true
backend = "local"
trace_dir = ".local/traces"
include_args = false
service_name = "my-zeph"
sample_rate = 0.1Fields§
§enabled: boolEnable tracing instrumentation. Default: false.
backend: TelemetryBackendBackend to use for trace export. Default: local.
trace_dir: PathBufDirectory for Chrome JSON trace files (used when backend = "local").
Default: ".local/traces".
include_args: boolInclude function arguments in span attributes. Set to true for local debugging.
Keep false (the default) in production to avoid logging potentially sensitive data
such as user messages, LLM responses, or tool outputs with PII.
otlp_endpoint: Option<String>OTLP gRPC endpoint URL (used when backend = "otlp").
Default: "http://localhost:4317" when unset.
otlp_headers_vault_key: Option<String>Vault key for OTLP authentication headers (e.g. ZEPH_OTLP_HEADERS).
When set, the value is resolved from the age vault at startup and passed as
Authorization or custom headers to the collector.
pyroscope_endpoint: Option<String>Pyroscope server URL (used when backend = "pyroscope").
service_name: StringService name reported in trace metadata. Default: "zeph-agent".
sample_rate: f64Fraction of traces to sample. 1.0 = record all, 0.1 = record 10%.
Applies only to the otlp backend; the local backend always records all spans.
Default: 1.0.
system_metrics_interval_secs: u64Interval in seconds between system-metrics snapshots (Phase 3). Default: 5.
Trait Implementations§
Source§impl Clone for TelemetryConfig
impl Clone for TelemetryConfig
Source§fn clone(&self) -> TelemetryConfig
fn clone(&self) -> TelemetryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TelemetryConfig
impl Debug for TelemetryConfig
Source§impl Default for TelemetryConfig
impl Default for TelemetryConfig
Source§fn default() -> TelemetryConfig
fn default() -> TelemetryConfig
Source§impl<'de> Deserialize<'de> for TelemetryConfig
impl<'de> Deserialize<'de> for TelemetryConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TelemetryConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TelemetryConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TelemetryConfig
impl Serialize for TelemetryConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TelemetryConfig
impl RefUnwindSafe for TelemetryConfig
impl Send for TelemetryConfig
impl Sync for TelemetryConfig
impl Unpin for TelemetryConfig
impl UnsafeUnpin for TelemetryConfig
impl UnwindSafe for TelemetryConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request