Ports for distributed tracing.
A minimal, backend-agnostic span/tracer abstraction. Feature code depends on
ITracer (via the wagoe.observability.tracing.core/with-span sugar) and
never on a concrete backend. The default adapter is no-op; a :logging
adapter records spans to the log; an OTLP adapter (OpenTelemetry) is wired
behind the same port so any OTel backend (SigNoz, Grafana Tempo, Jaeger, …)
works by pointing at its collector.
A span is an opaque handle returned by start-span! and passed back to the
other methods. No-op adapters may return a sentinel; real adapters return
whatever they need to correlate + finish the span.
Ports for distributed tracing. A minimal, backend-agnostic span/tracer abstraction. Feature code depends on `ITracer` (via the `wagoe.observability.tracing.core/with-span` sugar) and never on a concrete backend. The default adapter is no-op; a `:logging` adapter records spans to the log; an OTLP adapter (OpenTelemetry) is wired behind the same port so any OTel backend (SigNoz, Grafana Tempo, Jaeger, …) works by pointing at its collector. A `span` is an opaque handle returned by `start-span!` and passed back to the other methods. No-op adapters may return a sentinel; real adapters return whatever they need to correlate + finish the span.
Create and manage spans.
Create and manage spans.
(add-event! this span name)(add-event! this span name attributes)Record a timestamped event name (with optional attributes) on span.
Record a timestamped event `name` (with optional `attributes`) on `span`.
(end-span! this span)Finish span. Idempotent — ending an already-ended/nil span is a no-op.
Finish `span`. Idempotent — ending an already-ended/nil span is a no-op.
(record-exception! this span throwable)Record throwable on span and mark the span as errored.
Record `throwable` on `span` and mark the span as errored.
(set-attributes! this span attributes)Merge attributes (a map) onto span.
Merge `attributes` (a map) onto `span`.
(span-context this span)Return {:trace-id <str-or-nil> :span-id <str-or-nil>} for propagation and
log correlation. Returns nil ids for a no-op span.
Return `{:trace-id <str-or-nil> :span-id <str-or-nil>}` for propagation and
log correlation. Returns nil ids for a no-op span.(start-span! this name)(start-span! this name attributes)Start a span named name (string/keyword), optionally with an initial
attributes map, and return an opaque span handle. The span is a child of
the current active span when the adapter tracks context.
Start a span named `name` (string/keyword), optionally with an initial `attributes` map, and return an opaque span handle. The span is a child of the current active span when the adapter tracks context.
(with-span* this name attributes f)Run (f span): start a span, invoke f with it, end-span! it in a
finally, and record-exception! + rethrow on error. Returns f's value.
This is the primitive the with-span macro expands to.
Run `(f span)`: start a span, invoke `f` with it, `end-span!` it in a `finally`, and `record-exception!` + rethrow on error. Returns `f`'s value. This is the primitive the `with-span` macro expands to.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |