Axon Docs
GitHub Quickstart

Docs / API Reference

Axon.Server.OpenTelemetry

GoAxon.Server.OpenTelemetry — metrics and traces for job dispatch.

AddOpenTelemetryObservability

Extension method
AxonServerBuilder AddOpenTelemetryObservability(this AxonServerBuilder builder, Action<MeterProviderBuilder>? configureMetrics = null, Action<TracerProviderBuilder>? configureTracing = null)

Wires an OpenTelemetry SDK to Axon.Server's metrics and traces: job counts by outcome (enqueued / dispatched / succeeded / failed / retried / orphaned-reclaimed), queue depth, dispatch latency, and execution duration as metrics; spans around enqueue, claim/dispatch, ack, and orphan reclaim as traces.

This only registers Axon's meter and activity source with the SDK — it does not configure an exporter. Chain your own .AddOtlpExporter(), .AddConsoleExporter(), etc. via configureMetrics/configureTracing, or configure the SDK separately; Axon's signals will already be included in what it collects.

Defaults the sampler to AlwaysOnSampler. Axon's dispatch spans are created from a background service or a SignalR hub method, not an HTTP request, so the SDK's default ParentBasedSampler would otherwise inherit "don't record" from whatever ambient parent Activity happens to be current — silently dropping every Axon span with no error. Override via configureTracing for different sampling behavior.