Skip to main content

camel_api/
span_kind.rs

1/// Compile-time hint for the OpenTelemetry span kind of a step span.
2///
3/// Contract: this enum is a *compile-time* hint supplied by the DSL compiler
4/// when a `TracingProcessor` step span is built; the consumer converts it to
5/// `opentelemetry::trace::SpanKind` once at construction. The enum is
6/// `#[non_exhaustive]`: variants added in the future must degrade to
7/// [`SpanKindHint::Internal`] at the consumption site, never cause a compile
8/// failure downstream.
9#[non_exhaustive]
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
11pub enum SpanKindHint {
12    /// Internal span inside a route; the default for plain process steps.
13    #[default]
14    Internal,
15    /// Producer span for a step that sends a message to a destination.
16    Producer,
17    /// Consumer span for a step that consumes a message from a source.
18    Consumer,
19    /// Client span for a synchronous outbound call.
20    Client,
21    /// Server span for a synchronous inbound handler.
22    Server,
23}