Shuttle.Recall.OpenTelemetry 22.0.1

Prefix Reserved
dotnet add package Shuttle.Recall.OpenTelemetry --version 22.0.1
                    
NuGet\Install-Package Shuttle.Recall.OpenTelemetry -Version 22.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shuttle.Recall.OpenTelemetry" Version="22.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shuttle.Recall.OpenTelemetry" Version="22.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Shuttle.Recall.OpenTelemetry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Shuttle.Recall.OpenTelemetry --version 22.0.1
                    
#r "nuget: Shuttle.Recall.OpenTelemetry, 22.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Shuttle.Recall.OpenTelemetry@22.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Shuttle.Recall.OpenTelemetry&version=22.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Shuttle.Recall.OpenTelemetry&version=22.0.1
                    
Install as a Cake Tool

OpenTelemetry

Adds OpenTelemetry-compatible metrics and distributed tracing to Shuttle.Recall by observing the events already exposed on RecallOptions — no changes are required to your event handlers or projections.

This package is scoped to Recall-domain telemetry only (event envelopes, trace-context propagation, per-event spans). Pipeline-level instrumentation (execution duration, stage/event timing, failure counts) is already covered by Shuttle.Pipelines.OpenTelemetry, which observes the generic events on PipelineOptions that every Recall pipeline raises — add it alongside this package rather than duplicating that here.

Installation

dotnet add package Shuttle.Recall.OpenTelemetry
dotnet add package Shuttle.Pipelines.OpenTelemetry

Registration

services.AddRecall()
    .AddOpenTelemetry();

services.AddPipelines()
    .AddOpenTelemetry();

RecallBuilder.AddOpenTelemetry() subscribes to EventStore.PrimitiveEventsSaved, EventProcessing.EventHandled, and Operation on RecallOptions, recording metrics and tracing against sources named Shuttle.Recall.

The instrumentation is built on System.Diagnostics.ActivitySource / System.Diagnostics.Metrics.Meter directly, so this package has no dependency on the OpenTelemetry SDK — it only becomes "live" once something subscribes to those names, for example:

services.AddOpenTelemetry()
    .WithTracing(builder => builder.AddSource("Shuttle.Recall"))
    .WithMetrics(builder => builder.AddMeter("Shuttle.Recall").AddMeter("Shuttle.Pipelines"));

(Shuttle.Pipelines.OpenTelemetry only publishes metrics — it has no ActivitySource of its own.)

Metrics

Name Instrument Unit Description
recall.primitive_events.saved Counter {event} Number of primitive events saved to the event store, tagged recall.event.type.
recall.events.handled Counter {event} Number of events successfully handled by a projection, tagged recall.event.type and recall.projection.name.
recall.operations Counter {operation} Number of Shuttle.Recall infrastructure operations (event store, event processing, storage), tagged recall.operation.

Tracing

Tracing here is scoped to the event itself, not the pipelines that carry it — pair with Shuttle.Pipelines.OpenTelemetry if you also want pipeline-execution spans.

  • Process – once a projection has finished handling an event, EventEnvelope.Headers are extracted (via TraceContext.ExtractContext/ExtractBaggage) and used as the parent for a new Activity named after the event type, covering the handling of that one event. It is tagged with recall.id (the aggregate id), recall.event.id, recall.event.type, recall.event.version, recall.projection.name and recall.projection.sequence_number.

This span is deliberately opened and closed within the EventHandled handler rather than spanning from when the envelope was deserialized: deserialization also happens during plain aggregate replay (EventStore.GetAsync), which has no matching "handled" checkpoint to close a longer-lived span against.

This package does not itself write trace context into EventEnvelope.Headers when an event is saved — there is currently no "Save"-side span or automatic context propagation. TraceContext.Inject is exposed as an extension point (see below) if you want to propagate context yourself, e.g. from a custom pipeline observer that runs on save.

Extension points

  • RecallTelemetry.ActivitySource / RecallTelemetry.Meter – the shared instances used throughout; exposed so you can add your own spans or measurements under the same names.
  • TraceContext.Inject / TraceContext.ExtractContext / TraceContext.ExtractBaggage – W3C trace-context/baggage header helpers (traceparent/tracestate/baggage) for reading or writing EventEnvelope.Headers yourself. Only ExtractContext/ExtractBaggage are currently used by this package (on the processing side); Inject is unused internally and provided purely as a building block.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.