pub struct TracingProcessor { /* private fields */ }Expand description
A processor wrapper that emits tracing spans for each step.
This processor wraps another processor and adds distributed tracing by:
- Starting a native OpenTelemetry span for each exchange
- Propagating the OTel context through
exchange.otel_context - Recording errors and status on the span
When no OTel provider is configured (noop provider), spans are no-ops with minimal overhead.
Implementations§
Source§impl TracingProcessor
impl TracingProcessor
Sourcepub fn new(
inner: BoxProcessor,
route_id: String,
step_index: usize,
detail_level: DetailLevel,
metrics: Option<Arc<dyn MetricsCollector>>,
label: Option<Arc<str>>,
to_uri: Option<Arc<str>>,
kind_hint: SpanKindHint,
) -> Self
pub fn new( inner: BoxProcessor, route_id: String, step_index: usize, detail_level: DetailLevel, metrics: Option<Arc<dyn MetricsCollector>>, label: Option<Arc<str>>, to_uri: Option<Arc<str>>, kind_hint: SpanKindHint, ) -> Self
Wrap a processor with tracing.
label names the span after the DSL step it wraps (e.g. log,
to:direct); when None the span falls back to the positional
step-{index} id. kind_hint selects the OTel span kind for the
step span and is converted once here. to_uri carries the declared
endpoint URI for To steps (steplatency 2.1) and labels the
call-time step_duration_secs histogram; None for non-To steps.
Sourcepub fn with_spans_enabled(self, enabled: bool) -> Self
pub fn with_spans_enabled(self, enabled: bool) -> Self
Sets whether step spans are created (metrics still flow when off).
Sourcepub fn with_metric_levers(self, levers: MetricsLeversConfig) -> Self
pub fn with_metric_levers(self, levers: MetricsLeversConfig) -> Self
Sets the per-family metric levers. The error family ignores them.
Trait Implementations§
Source§impl Clone for TracingProcessor
impl Clone for TracingProcessor
Source§impl Service<Exchange> for TracingProcessor
impl Service<Exchange> for TracingProcessor
Source§type Error = CamelError
type Error = CamelError
Source§type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send>>
Auto Trait Implementations§
impl !RefUnwindSafe for TracingProcessor
impl !UnwindSafe for TracingProcessor
impl Freeze for TracingProcessor
impl Send for TracingProcessor
impl Sync for TracingProcessor
impl Unpin for TracingProcessor
impl UnsafeUnpin for TracingProcessor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<P> Processor for P
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, Request> ServiceExt<Request> for T
impl<T, Request> ServiceExt<Request> for T
Source§fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
Source§fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
Source§fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
Service, calling it with the provided request once it is ready.Source§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
poll_ready method. Read moreSource§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
poll_ready method. Read moreSource§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
poll_ready method. Read moreSource§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Result<Self::Response, Self::Error>)
to a different value, regardless of whether the future succeeds or
fails. Read more