Struct SimpleSpanProcessor
pub struct SimpleSpanProcessor<T>where
T: SpanExporter,{ /* private fields */ }opentelemetry and trace only.Expand description
A SpanProcessor that passes finished spans to the configured
SpanExporter, as soon as they are finished, without any batching. This is
typically useful for debugging and testing. For scenarios requiring higher
performance/throughput, consider using BatchSpanProcessor.
Spans are exported synchronously
in the same thread that emits the log record.
When using this processor with the OTLP Exporter, the following exporter
features are supported:
grpc-tonic: This requires TracerProvider to be created within a tokio runtime. Spans can be emitted from any thread, including tokio runtime threads.reqwest-blocking-client: TracerProvider may be created anywhere, but spans must be emitted from a non-tokio runtime thread.reqwest-client: TracerProvider may be created anywhere, but spans must be emitted from a tokio runtime thread.
The OTLP HTTP exporter chooses its default HTTP client from enabled crate
features. That choice is not processor-aware. If you enable async HTTP
clients such as reqwest-client or hyper-client, ensure this processor is
only used from a thread where those clients can run.
Implementations§
§impl<T> SimpleSpanProcessor<T>where
T: SpanExporter,
impl<T> SimpleSpanProcessor<T>where
T: SpanExporter,
pub fn new(exporter: T) -> SimpleSpanProcessor<T>
pub fn new(exporter: T) -> SimpleSpanProcessor<T>
Create a new SimpleSpanProcessor using the provided exporter.
Trait Implementations§
§impl<T> Debug for SimpleSpanProcessor<T>where
T: Debug + SpanExporter,
impl<T> Debug for SimpleSpanProcessor<T>where
T: Debug + SpanExporter,
§impl<T> SpanProcessor for SimpleSpanProcessor<T>where
T: SpanExporter,
impl<T> SpanProcessor for SimpleSpanProcessor<T>where
T: SpanExporter,
§fn on_start(&self, _span: &mut Span, _cx: &Context)
fn on_start(&self, _span: &mut Span, _cx: &Context)
on_start is called when a Span is started. This method is called
synchronously on the thread that started the span, therefore it should
not block or throw exceptions.§fn on_end(&self, span: SpanData)
fn on_end(&self, span: SpanData)
on_end is called after a Span is ended (i.e., the end timestamp is
already set). This method is called synchronously within the Span::end
API, therefore it should not block or throw an exception. Read more§fn force_flush(&self) -> Result<(), OTelSdkError>
fn force_flush(&self) -> Result<(), OTelSdkError>
§fn shutdown_with_timeout(&self, timeout: Duration) -> Result<(), OTelSdkError>
fn shutdown_with_timeout(&self, timeout: Duration) -> Result<(), OTelSdkError>
§fn set_resource(&mut self, resource: &Resource)
fn set_resource(&mut self, resource: &Resource)
§fn shutdown(&self) -> Result<(), OTelSdkError>
fn shutdown(&self) -> Result<(), OTelSdkError>
Auto Trait Implementations§
impl<T> !Freeze for SimpleSpanProcessor<T>
impl<T> RefUnwindSafe for SimpleSpanProcessor<T>
impl<T> Send for SimpleSpanProcessor<T>
impl<T> Sync for SimpleSpanProcessor<T>
impl<T> Unpin for SimpleSpanProcessor<T>where
T: Unpin,
impl<T> UnsafeUnpin for SimpleSpanProcessor<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SimpleSpanProcessor<T>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer