pub struct OtlpExporter { /* private fields */ }Expand description
Synchronous HTTP/JSON exporter to an OTLP-compatible collector.
Construct via OtlpExporter::builder. Send records one at a
time with OtlpExporter::export_one or in a batch with
OtlpExporter::export_batch.
Implementations§
Source§impl OtlpExporter
impl OtlpExporter
Sourcepub fn builder() -> OtlpExporterBuilder
pub fn builder() -> OtlpExporterBuilder
Start building a new exporter.
Sourcepub fn export_one(&self, record: &Log) -> OtlpResult<()>
pub fn export_one(&self, record: &Log) -> OtlpResult<()>
Export a single record. Renders the record as
LogFormat::OTLP, wraps it in the OTLP/HTTP envelope, and
POSTs it to the configured endpoint.
§Errors
Returns OtlpError on transport failure, non-2xx response,
or serialisation failure, and OtlpError::InvalidEndpoint
or OtlpError::InvalidHeader, before any request, when the
builder was given an endpoint other than http:// or an
unsafe header.
Sourcepub fn export_batch(&self, records: &[Log]) -> OtlpResult<()>
pub fn export_batch(&self, records: &[Log]) -> OtlpResult<()>
Trait Implementations§
Source§impl Clone for OtlpExporter
impl Clone for OtlpExporter
Auto Trait Implementations§
impl Forget for OtlpExporter
impl Freeze for OtlpExporter
impl RefUnwindSafe for OtlpExporter
impl Send for OtlpExporter
impl Sync for OtlpExporter
impl Unpin for OtlpExporter
impl UnsafeUnpin for OtlpExporter
impl UnwindSafe for OtlpExporter
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