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,
) -> OtlpHttpExporter
pub fn new( endpoint: &str, service_name: &str, service_version: &str, ) -> OtlpHttpExporter
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)>) -> OtlpHttpExporter
pub fn with_headers(self, headers: Vec<(String, String)>) -> OtlpHttpExporter
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more