Registration
Register Wolverine.CritterWatch inside your UseWolverine() configuration block. The call must come after transport configuration so the observer can use the transport to publish telemetry.
Simple Registration
The shortest form takes a transport URI and service name:
builder.Host.UseWolverine(opts =>
{
opts.UseRabbitMq(new Uri("amqp://localhost")).AutoProvision();
opts.AddCritterWatchMonitoring("amqp://localhost", "my-service");
});Full Options
builder.Host.UseWolverine(opts =>
{
opts.AddCritterWatchMonitoring(
// URI of the queue CritterWatch listens on for telemetry
critterWatchUri: new Uri("rabbitmq://critterwatch"),
// URI of the queue this service listens on for incoming commands
systemControlUri: new Uri("rabbitmq://trip-service-control"),
// How this service exports metrics (default: Hybrid)
metricsMode: WolverineMetricsMode.Hybrid
);
});What AddCritterWatchMonitoring() Registers
Calling this method:
- Registers
CritterWatchObserveras anIWolverineObserversingleton in the DI container - Configures inbound command handling — registers Wolverine handlers for all 22+ inbound command types (replay, pause, rebuild, etc.)
- Sets up message routing — configures the transport queue for commands from CritterWatch and the publishing endpoint for telemetry
- Wires up the batching pipeline — connects the observer to the publishing timer
What It Does NOT Require
- No changes to your handlers, aggregates, or domain code
- No changes to your database schema
- No additional database connections
- No additional processes
The observer uses the same Wolverine transport already configured in your service.
Multiple Services
Each service must have a unique ServiceName. CritterWatch uses this as the primary key for all service data. Two services with the same name will appear as a single entry in CritterWatch, with state from both processes intermixed.
// TripService/Program.cs
opts.AddCritterWatchMonitoring("amqp://localhost", "trip-service");
// RepairShop/Program.cs
opts.AddCritterWatchMonitoring("amqp://localhost", "repair-shop");Non-RabbitMQ Transports
The first argument to AddCritterWatchMonitoring() is used to configure the publishing destination. For non-RabbitMQ transports, use the full options form and configure accordingly.
TIP
RabbitMQ is strongly recommended for production use because it provides reliable message delivery between services and CritterWatch. In-memory transport is suitable for development but does not persist messages if either process restarts.
