pub struct TelemetryConfig {
pub service_name: String,
pub resource_attributes: Vec<(String, String)>,
pub traces_enabled: bool,
pub metrics_enabled: bool,
pub logs_enabled: bool,
pub otlp_protocol: OtlpProtocol,
pub otlp_endpoint: Option<String>,
pub otlp_headers: Vec<(String, String)>,
pub rust_log: String,
pub json_logging: bool,
pub metrics_export_interval_ms: u64,
pub propagators: Vec<PropagatorKind>,
}Expand description
Configuration for telemetry initialization.
Fields§
§service_name: StringService name, sent as the service.name resource attribute.
resource_attributes: Vec<(String, String)>Extra resource attributes attached to every span/metric/log.
traces_enabled: boolEnable/disable trace export (default: true).
metrics_enabled: boolEnable/disable metrics export (default: true).
logs_enabled: boolEnable/disable log export (default: true).
otlp_protocol: OtlpProtocolWhich OTLP wire protocol to use (default: OtlpProtocol::Grpc).
otlp_endpoint: Option<String>OTLP endpoint, e.g. http://localhost:4317. When None, the
exporter falls back to the protocol-specific default
(http://localhost:4317 for gRPC, http://localhost:4318 for
HTTP/protobuf).
otlp_headers: Vec<(String, String)>Extra headers sent with every OTLP export request (e.g. API keys).
rust_log: StringRUST_LOG filter for both console output and the OTel logs bridge.
json_logging: boolEnable JSON-formatted console logging (default: false).
metrics_export_interval_ms: u64Metrics export interval, in milliseconds (default: 60000).
propagators: Vec<PropagatorKind>Which context propagation format(s) to install globally (default:
[TraceContext, Baggage], matching the OTEL_PROPAGATORS spec
default). An empty list disables propagation entirely.
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn builder() -> TelemetryConfigBuilder
pub fn builder() -> TelemetryConfigBuilder
Create a builder for custom configuration.
Trait Implementations§
Source§impl Clone for TelemetryConfig
impl Clone for TelemetryConfig
Source§fn clone(&self) -> TelemetryConfig
fn clone(&self) -> TelemetryConfig
1.0.0 (const: unstable) · 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
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
T in a tonic::Request