pub struct TelemetryConfig {
pub service_name: String,
pub log: LogConfig,
pub metrics: MetricsConfig,
pub otel: OtelConfig,
}Expand description
Top-level telemetry settings for a service.
Fields§
§service_name: StringService name reported in logs, metrics, and traces.
log: LogConfigLogging / tracing-subscriber settings.
metrics: MetricsConfigPrometheus metrics settings.
otel: OtelConfigOpenTelemetry (OTLP) trace export settings.
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn for_profile(profile: &Profile, service_name: impl Into<String>) -> Self
pub fn for_profile(profile: &Profile, service_name: impl Into<String>) -> Self
A config for service_name with profile-appropriate defaults: human
Pretty logs on local/dev/test, structured Json logs on staging/prod.
Trait Implementations§
Source§impl Clone for TelemetryConfig
impl Clone for TelemetryConfig
Source§fn clone(&self) -> TelemetryConfig
fn clone(&self) -> TelemetryConfig
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 moreSource§impl Debug for TelemetryConfig
impl Debug for TelemetryConfig
Source§impl Default for TelemetryConfig
impl Default for TelemetryConfig
Source§impl<'de> Deserialize<'de> for TelemetryConfig
impl<'de> Deserialize<'de> for TelemetryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more