pub struct ObservabilityConfig {
pub namespace: Cow<'static, str>,
pub histogram: HistogramConfig,
}Expand description
Observability configuration.
Cheap to construct, Clone-able, and Send + Sync. The captured
namespace is used as a prefix for every OTel instrument name
("{namespace}.session.packets", etc.). Default prefix is "phantom".
Fields§
§namespace: Cow<'static, str>Instrument-name prefix. Default "phantom".
Populated from PHANTOM_TELEMETRY_NAMESPACE by Self::from_env.
Note: this prefixes metric instrument names only. tracing
span names are compile-time string literals (phantom.handshake.*,
phantom.listener.*) and are not affected by this knob.
histogram: HistogramConfigBucket boundaries for latency instruments
(handshake.duration, path.validation.duration).
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Construct a config from environment variables. Unset or empty variables fall back to defaults.
To disable telemetry at runtime, build without the telemetry-otel
Cargo feature, or simply do not point OTEL_EXPORTER_OTLP_ENDPOINT
at a reachable collector — the SDK’s bounded export queue then drops
telemetry at near-zero cost.
Sourcepub fn builder() -> ObservabilityConfigBuilder
pub fn builder() -> ObservabilityConfigBuilder
Begin a programmatic builder for ObservabilityConfig.
Trait Implementations§
Source§impl Clone for ObservabilityConfig
impl Clone for ObservabilityConfig
Source§fn clone(&self) -> ObservabilityConfig
fn clone(&self) -> ObservabilityConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more