pub struct TelemetryConfig {
pub service_name: String,
pub log_level: String,
pub log_format: LogFormat,
pub otlp_endpoint: Option<String>,
pub otlp_protocol: OtlpProtocol,
pub otlp_headers: Vec<(String, String)>,
pub trace_sampling: f64,
pub artifact_hash: Option<String>,
}Expand description
Telemetry configuration.
Fields§
§service_name: StringService name for telemetry (default: “barbacane”).
log_level: StringLog level filter (default: “info”).
log_format: LogFormatLog output format.
otlp_endpoint: Option<String>OTLP endpoint for trace/metric export (optional). If not set, OTLP export is disabled.
otlp_protocol: OtlpProtocolOTLP protocol to use.
otlp_headers: Vec<(String, String)>Additional OTLP headers (e.g., for authentication).
trace_sampling: f64Global trace sampling rate (0.0 to 1.0, default: 1.0).
artifact_hash: Option<String>Artifact hash for span attributes (set at runtime).
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn with_service_name(self, name: impl Into<String>) -> Self
pub fn with_service_name(self, name: impl Into<String>) -> Self
Set the service name.
Sourcepub fn with_log_level(self, level: impl Into<String>) -> Self
pub fn with_log_level(self, level: impl Into<String>) -> Self
Set the log level.
Sourcepub fn with_log_format(self, format: LogFormat) -> Self
pub fn with_log_format(self, format: LogFormat) -> Self
Set the log format.
Sourcepub fn with_otlp_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_otlp_endpoint(self, endpoint: impl Into<String>) -> Self
Set the OTLP endpoint.
Sourcepub fn with_otlp_protocol(self, protocol: OtlpProtocol) -> Self
pub fn with_otlp_protocol(self, protocol: OtlpProtocol) -> Self
Set the OTLP protocol.
Sourcepub fn with_trace_sampling(self, rate: f64) -> Self
pub fn with_trace_sampling(self, rate: f64) -> Self
Set the trace sampling rate.
Sourcepub fn with_artifact_hash(self, hash: impl Into<String>) -> Self
pub fn with_artifact_hash(self, hash: impl Into<String>) -> Self
Set the artifact hash.
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