pub struct HttpExporterBuilder { /* private fields */ }
Available on crate features
http-proto
or http-json
only.Expand description
Configuration for the OTLP HTTP exporter.
§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_http().build()?;
// Create a metrics exporter you can use when configuring meter providers
let metrics_exporter = opentelemetry_otlp::MetricExporter::builder()
.with_http()
.with_temporality(Temporality::default())
.build()?;
// Create a log exporter you can use when configuring logger providers
let log_exporter = opentelemetry_otlp::LogExporter::builder().with_http().build()?;
Implementations§
Source§impl HttpExporterBuilder
impl HttpExporterBuilder
Sourcepub fn build_span_exporter(self) -> Result<SpanExporter, TraceError>
Available on crate feature trace
only.
pub fn build_span_exporter(self) -> Result<SpanExporter, TraceError>
trace
only.Create a log exporter with the current configuration
Sourcepub fn build_log_exporter(self) -> LogResult<LogExporter>
Available on crate feature logs
only.
pub fn build_log_exporter(self) -> LogResult<LogExporter>
logs
only.Create a log exporter with the current configuration
Sourcepub fn build_metrics_exporter(
self,
temporality: Temporality,
) -> MetricResult<MetricExporter>
Available on crate feature metrics
only.
pub fn build_metrics_exporter( self, temporality: Temporality, ) -> MetricResult<MetricExporter>
metrics
only.Create a metrics exporter with the current configuration
Trait Implementations§
Source§impl Debug for HttpExporterBuilder
impl Debug for HttpExporterBuilder
Source§impl Default for HttpExporterBuilder
impl Default for HttpExporterBuilder
Source§impl HasExportConfig for HttpExporterBuilder
impl HasExportConfig for HttpExporterBuilder
Provide ExportConfig access to the HttpExporterBuilder.
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 HasHttpConfig for HttpExporterBuilder
impl HasHttpConfig for HttpExporterBuilder
Expose interface for modifying builder config.
Source§fn http_client_config(&mut self) -> &mut HttpConfig
fn http_client_config(&mut self) -> &mut HttpConfig
Return a mutable reference to the config within the exporter builders.
Auto Trait Implementations§
impl Freeze for HttpExporterBuilder
impl !RefUnwindSafe for HttpExporterBuilder
impl Send for HttpExporterBuilder
impl Sync for HttpExporterBuilder
impl Unpin for HttpExporterBuilder
impl !UnwindSafe for HttpExporterBuilder
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<B> WithHttpConfig for Bwhere
B: HasHttpConfig,
impl<B> WithHttpConfig for Bwhere
B: HasHttpConfig,
Source§fn with_http_client<T>(self, client: T) -> Bwhere
T: HttpClient + 'static,
fn with_http_client<T>(self, client: T) -> Bwhere
T: HttpClient + 'static,
Available on crate features
http-proto
or http-json
only.Assign client implementation