pub struct OpenTelemetryConfig { /* private fields */ }Expand description
Configuration for the OpenTelemetry subscriber.
Implementations§
Source§impl OpenTelemetryConfig
impl OpenTelemetryConfig
Sourcepub fn new(otel_type: OpenTelemetryType, endpoint: impl Into<String>) -> Self
pub fn new(otel_type: OpenTelemetryType, endpoint: impl Into<String>) -> Self
Creates a typed OpenTelemetry exporter for a required OTLP endpoint.
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_transport(self, transport: OtlpTransport) -> Self
pub fn with_transport(self, transport: OtlpTransport) -> Self
Selects the OTLP transport.
Sourcepub fn with_service_name(self, service_name: impl Into<String>) -> Self
pub fn with_service_name(self, service_name: impl Into<String>) -> Self
Sets the service.name resource attribute.
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.
Sourcepub fn with_mark_projection(self, mark_projection: MarkProjection) -> Self
pub fn with_mark_projection(self, mark_projection: MarkProjection) -> Self
Selects how point-in-time marks are represented in exported traces.
Sourcepub fn with_mark_exclude_names<I, S>(self, names: I) -> Self
pub fn with_mark_exclude_names<I, S>(self, names: I) -> Self
Excludes named marks from tool projection.
Sourcepub fn with_attribute_mapping(
self,
key: impl Into<String>,
alias: impl Into<String>,
) -> Self
pub fn with_attribute_mapping( self, key: impl Into<String>, alias: impl Into<String>, ) -> Self
Adds a projected OpenTelemetry attribute alias.
Sourcepub fn with_attribute_mappings<I>(self, mappings: I) -> Selfwhere
I: IntoIterator<Item = OtlpAttributeMapping>,
pub fn with_attribute_mappings<I>(self, mappings: I) -> Selfwhere
I: IntoIterator<Item = OtlpAttributeMapping>,
Replaces projected OpenTelemetry attribute aliases.
Trait Implementations§
Source§impl Clone for OpenTelemetryConfig
impl Clone for OpenTelemetryConfig
Source§fn clone(&self) -> OpenTelemetryConfig
fn clone(&self) -> OpenTelemetryConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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