pub struct AsyncOtlpExporterBuilder { /* private fields */ }Available on crate feature
async only.Expand description
Fluent builder for AsyncOtlpExporter.
Implementations§
Source§impl AsyncOtlpExporterBuilder
impl AsyncOtlpExporterBuilder
Sourcepub fn endpoint(self, url: impl Into<String>) -> Self
pub fn endpoint(self, url: impl Into<String>) -> Self
Set the collector endpoint URL. Must be http://; the
default is DEFAULT_ENDPOINT, a Collector on this host.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Set a custom request header. Call repeatedly for multiple.
Sourcepub fn timeout_secs(self, secs: u64) -> Self
pub fn timeout_secs(self, secs: u64) -> Self
Per-request timeout, covering connect, send and the response head. Default is 10 s.
Sourcepub const fn max_retries(self, n: u32) -> Self
pub const fn max_retries(self, n: u32) -> Self
Maximum retry attempts. Default is 3.
Sourcepub const fn backoff_base(self, base: Duration) -> Self
pub const fn backoff_base(self, base: Duration) -> Self
Base for the exponential-with-jitter backoff. Default is 200 ms.
Sourcepub fn circuit(self, cb: Arc<CircuitBreaker>) -> Self
pub fn circuit(self, cb: Arc<CircuitBreaker>) -> Self
Attach an optional circuit breaker.
Sourcepub fn build(self) -> OtlpResult<AsyncOtlpExporter>
pub fn build(self) -> OtlpResult<AsyncOtlpExporter>
Finalise the builder.
§Errors
Returns OtlpError::InvalidEndpoint if the endpoint is not
an http:// URL (https:// included: TLS belongs to the
collector), or OtlpError::InvalidHeader if a header name
is invalid, a value holds a line break, or the header is one
the exporter sets itself.
Trait Implementations§
Source§impl Clone for AsyncOtlpExporterBuilder
impl Clone for AsyncOtlpExporterBuilder
Source§impl Debug for AsyncOtlpExporterBuilder
impl Debug for AsyncOtlpExporterBuilder
Auto Trait Implementations§
impl Forget for AsyncOtlpExporterBuilder
impl Freeze for AsyncOtlpExporterBuilder
impl RefUnwindSafe for AsyncOtlpExporterBuilder
impl Send for AsyncOtlpExporterBuilder
impl Sync for AsyncOtlpExporterBuilder
impl Unpin for AsyncOtlpExporterBuilder
impl UnsafeUnpin for AsyncOtlpExporterBuilder
impl UnwindSafe for AsyncOtlpExporterBuilder
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