pub struct TelemetryConfig {
pub service_name: String,
pub service_version: String,
pub service_namespace: Option<String>,
pub service_instance_id: Option<String>,
pub enable_traces: bool,
pub enable_metrics: bool,
pub enable_logs: bool,
pub jaeger_endpoint: Option<String>,
pub prometheus_endpoint: Option<String>,
pub otlp_endpoint: Option<String>,
pub sampling_rate: f64,
pub resource_attributes: Vec<(String, String)>,
}Expand description
Telemetry configuration.
Fields§
§service_name: StringService name.
service_version: StringService version.
service_namespace: Option<String>Service namespace.
service_instance_id: Option<String>Service instance ID.
enable_traces: boolEnable traces.
enable_metrics: boolEnable metrics.
enable_logs: boolEnable logs.
jaeger_endpoint: Option<String>Jaeger endpoint for traces.
prometheus_endpoint: Option<String>Prometheus endpoint for metrics.
otlp_endpoint: Option<String>OTLP endpoint (supports all signals).
sampling_rate: f64Sampling rate (0.0 to 1.0).
resource_attributes: Vec<(String, String)>Custom resource attributes.
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn with_service_version(self, version: impl Into<String>) -> Self
pub fn with_service_version(self, version: impl Into<String>) -> Self
Set service version.
Sourcepub fn with_service_namespace(self, namespace: impl Into<String>) -> Self
pub fn with_service_namespace(self, namespace: impl Into<String>) -> Self
Set service namespace.
Sourcepub fn with_service_instance_id(self, instance_id: impl Into<String>) -> Self
pub fn with_service_instance_id(self, instance_id: impl Into<String>) -> Self
Set service instance ID.
Sourcepub fn with_traces(self, enable: bool) -> Self
pub fn with_traces(self, enable: bool) -> Self
Enable or disable traces.
Sourcepub fn with_metrics(self, enable: bool) -> Self
pub fn with_metrics(self, enable: bool) -> Self
Enable or disable metrics.
Sourcepub fn with_jaeger_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_jaeger_endpoint(self, endpoint: impl Into<String>) -> Self
Set Jaeger endpoint.
Sourcepub fn with_prometheus_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_prometheus_endpoint(self, endpoint: impl Into<String>) -> Self
Set Prometheus endpoint.
Sourcepub fn with_otlp_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_otlp_endpoint(self, endpoint: impl Into<String>) -> Self
Set OTLP endpoint.
Sourcepub fn with_sampling_rate(self, rate: f64) -> Self
pub fn with_sampling_rate(self, rate: f64) -> Self
Set sampling rate.
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 · 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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request