pub struct OtlpActionTraceSink { /* private fields */ }
Expand description
A bridge from action-trace to batched opentelemetry trace services.
Implementations§
Source§impl OtlpActionTraceSink
impl OtlpActionTraceSink
pub fn new( otlp_endpoint: &str, interceptors: Option<Box<dyn RequestInterceptor>>, batch_size: usize, insecure: bool, attributes: OtlpAttributes, ) -> Result<Self, Box<dyn Error>>
pub fn drain_batch(&self)
Sourcepub fn send(&self, span: impl Into<Span>)
pub fn send(&self, span: impl Into<Span>)
Spans are batched up and sent to your downstream.
See send_many()
instead if you have a collection of spans to send.
sink.send(span);
Sourcepub fn send_many(&self, batch: impl IntoIterator<Item = impl Into<Span>>)
pub fn send_many(&self, batch: impl IntoIterator<Item = impl Into<Span>>)
Spans are batched up and sent to your downstream.
Use this over send()
when you have already collected spans to avoid needless extra synchronization cost.
let batch = vec![span1, span2]; // Collect a batch somehow
sink.send_many(batch); // Send them all at once
Trait Implementations§
Source§impl TraceSink for OtlpActionTraceSink
impl TraceSink for OtlpActionTraceSink
fn sink_trace(&self, trace: &mut ActionSpan)
Auto Trait Implementations§
impl !Freeze for OtlpActionTraceSink
impl !RefUnwindSafe for OtlpActionTraceSink
impl Send for OtlpActionTraceSink
impl Sync for OtlpActionTraceSink
impl Unpin for OtlpActionTraceSink
impl !UnwindSafe for OtlpActionTraceSink
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request