Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Observability

The middleware emits tracing spans at key advancement points. These are compatible with any tracing subscriber:

  • tracing-subscriber for structured stdout/JSON logs
  • tracing-opentelemetry for exporting to Jaeger, Tempo, or Datadog
  • tracing-appender for file-based log output

Spans

SpanFieldsEmitted when
post_savetask_idA completed task enters the middleware
execute_stepstep_indexThe middleware dispatches the next operation
handle_fan_out_childtask_idA fan-out child completes
gather_resultschild_countBarrier fires and results are fetched

Spans nest naturally: a post_save span contains an execute_step span, which may contain a gather_results span. This gives a trace tree of the full pipeline advancement.

Setup

Orchis does nothing visible until you wire up a subscriber. In your worker binary:

use tracing_subscriber::{fmt, EnvFilter};

fn main() {
    fmt()
        .with_env_filter(EnvFilter::from_default_env())
        .json()
        .init();

    // ... start worker
}

Then run with RUST_LOG=orchis_core=debug to see middleware spans.

For OpenTelemetry export:

use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;

fn main() {
    let tracer = opentelemetry_otlp::new_pipeline()
        .tracing()
        .install_batch(opentelemetry_sdk::runtime::Tokio)
        .unwrap();

    tracing_subscriber::registry()
        .with(tracing_opentelemetry::layer().with_tracer(tracer))
        .init();

    // ... start worker
}

Each pipeline invocation shares a _run_id label across all tasks, which you can use to correlate spans across workers.