pub struct OtlpHttpExporter { /* private fields */ }Expand description
Send spans to an OTLP-compatible collector over HTTP (JSON encoding).
Compatible with Jaeger ≥ 1.35, Grafana Tempo, and OpenTelemetry Collector.
Point at http://localhost:4318 (the default OTLP HTTP port).
Implementations§
Source§impl OtlpHttpExporter
impl OtlpHttpExporter
Sourcepub fn new(endpoint: &str, service_name: &str, service_version: &str) -> Self
pub fn new(endpoint: &str, service_name: &str, service_version: &str) -> Self
endpoint is the collector’s base URL (http://localhost:4318, spans
go to /v1/traces under it) or the full traces URL ending in
/v1/traces. https:// works too.
Sourcepub fn with_headers(self, headers: Vec<(String, String)>) -> Self
pub fn with_headers(self, headers: Vec<(String, String)>) -> Self
Send these headers with every export (an API key, for instance).
pub fn build_body(&self, spans: &[SpanData]) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OtlpHttpExporter
impl RefUnwindSafe for OtlpHttpExporter
impl Send for OtlpHttpExporter
impl Sync for OtlpHttpExporter
impl Unpin for OtlpHttpExporter
impl UnsafeUnpin for OtlpHttpExporter
impl UnwindSafe for OtlpHttpExporter
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