pub struct OpenTelemetryConfig { /* private fields */ }Expand description
Configuration for the OpenTelemetry subscriber.
Implementations§
Source§impl OpenTelemetryConfig
impl OpenTelemetryConfig
Sourcepub fn http_binary(service_name: impl Into<String>) -> Self
pub fn http_binary(service_name: impl Into<String>) -> Self
Creates an HTTP OTLP config for the given service name.
Sourcepub fn grpc(service_name: impl Into<String>) -> Self
pub fn grpc(service_name: impl Into<String>) -> Self
Creates a gRPC OTLP config for the given service name.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Overrides the OTLP endpoint. If unset, exporter defaults and OTEL_* env vars apply.
Sourcepub fn with_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a header/metadata entry for the exporter.
Sourcepub fn with_resource_attribute(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_resource_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a resource attribute as a string key/value pair.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the OTLP request timeout.
Sourcepub fn with_service_namespace(self, namespace: impl Into<String>) -> Self
pub fn with_service_namespace(self, namespace: impl Into<String>) -> Self
Sets the service namespace resource attribute.
Sourcepub fn with_service_version(self, version: impl Into<String>) -> Self
pub fn with_service_version(self, version: impl Into<String>) -> Self
Sets the service version resource attribute.
Sourcepub fn with_instrumentation_scope(self, scope: impl Into<String>) -> Self
pub fn with_instrumentation_scope(self, scope: impl Into<String>) -> Self
Sets the instrumentation scope name used for emitted spans.
Trait Implementations§
Source§impl Clone for OpenTelemetryConfig
impl Clone for OpenTelemetryConfig
Source§fn clone(&self) -> OpenTelemetryConfig
fn clone(&self) -> OpenTelemetryConfig
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 OpenTelemetryConfig
impl Debug for OpenTelemetryConfig
Auto Trait Implementations§
impl Freeze for OpenTelemetryConfig
impl RefUnwindSafe for OpenTelemetryConfig
impl Send for OpenTelemetryConfig
impl Sync for OpenTelemetryConfig
impl Unpin for OpenTelemetryConfig
impl UnsafeUnpin for OpenTelemetryConfig
impl UnwindSafe for OpenTelemetryConfig
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