pub struct TonicExporterBuilder { /* private fields */ }
Available on crate feature
grpc-tonic
only.Expand description
Configuration for the tonic OTLP GRPC exporter.
It allows you to
- add additional metadata
- set tls config (via the
tls
feature) - specify custom channels
§Examples
use opentelemetry_sdk::metrics::Temporality;
// Create a span exporter you can use to when configuring tracer providers
let span_exporter = opentelemetry_otlp::SpanExporter::builder().with_tonic().build()?;
// Create a metric exporter you can use when configuring meter providers
let metric_exporter = opentelemetry_otlp::MetricExporter::builder()
.with_tonic()
.with_temporality(Temporality::default())
.build()?;
// Create a log exporter you can use when configuring logger providers
let log_exporter = opentelemetry_otlp::LogExporter::builder().with_tonic().build()?;
Trait Implementations§
Source§impl Debug for TonicExporterBuilder
impl Debug for TonicExporterBuilder
Source§impl Default for TonicExporterBuilder
impl Default for TonicExporterBuilder
Source§impl HasExportConfig for TonicExporterBuilder
impl HasExportConfig for TonicExporterBuilder
Provide ExportConfig access to the TonicExporterBuilder.
Source§fn export_config(&mut self) -> &mut ExportConfig
fn export_config(&mut self) -> &mut ExportConfig
Return a mutable reference to the ExportConfig within the exporter builders.
Source§impl HasTonicConfig for TonicExporterBuilder
impl HasTonicConfig for TonicExporterBuilder
Expose interface for modifying TonicConfig fields within the TonicExporterBuilder.
Source§fn tonic_config(&mut self) -> &mut TonicConfig
fn tonic_config(&mut self) -> &mut TonicConfig
Return a mutable reference to the export config within the exporter builders.
Auto Trait Implementations§
impl Freeze for TonicExporterBuilder
impl !RefUnwindSafe for TonicExporterBuilder
impl Send for TonicExporterBuilder
impl Sync for TonicExporterBuilder
impl Unpin for TonicExporterBuilder
impl !UnwindSafe for TonicExporterBuilder
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> 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
Source§impl<B> WithExportConfig for Bwhere
B: HasExportConfig,
impl<B> WithExportConfig for Bwhere
B: HasExportConfig,
Source§fn with_endpoint<T>(self, endpoint: T) -> B
fn with_endpoint<T>(self, endpoint: T) -> B
Set the address of the OTLP collector. If not set or set to empty string, the default address is used.
Source§fn with_protocol(self, protocol: Protocol) -> B
fn with_protocol(self, protocol: Protocol) -> B
Set the protocol to use when communicating with the collector. Read more
Source§fn with_timeout(self, timeout: Duration) -> B
fn with_timeout(self, timeout: Duration) -> B
Set the timeout to the collector.
Source§fn with_export_config(self, exporter_config: ExportConfig) -> B
fn with_export_config(self, exporter_config: ExportConfig) -> B
Set export config. This will override all previous configuration.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<B> WithTonicConfig for Bwhere
B: HasTonicConfig,
impl<B> WithTonicConfig for Bwhere
B: HasTonicConfig,
Source§fn with_metadata(self, metadata: MetadataMap) -> B
Available on crate feature grpc-tonic
only.
fn with_metadata(self, metadata: MetadataMap) -> B
grpc-tonic
only.Set custom metadata entries to send to the collector.
Source§fn with_tls_config(self, tls_config: ClientTlsConfig) -> B
fn with_tls_config(self, tls_config: ClientTlsConfig) -> B
Available on crate features
grpc-tonic
and tls
only.Set the TLS settings for the collector endpoint.
Source§fn with_compression(self, compression: Compression) -> B
fn with_compression(self, compression: Compression) -> B
Available on crate feature
grpc-tonic
only.Set the compression algorithm to use when communicating with the collector.
Source§fn with_channel(self, channel: Channel) -> B
fn with_channel(self, channel: Channel) -> B
Available on crate feature
grpc-tonic
only.Use
channel
as tonic’s transport channel.
this will override tls config and should only be used
when working with non-HTTP transports. Read moreSource§fn with_interceptor<I>(self, interceptor: I) -> B
fn with_interceptor<I>(self, interceptor: I) -> B
Available on crate feature
grpc-tonic
only.Use a custom
interceptor
to modify each outbound request.
this can be used to modify the grpc metadata, for example
to inject auth tokens.