pub struct OtlpHttpExporter { /* private fields */ }Available on non-WebAssembly only.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more