Skip to content

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:

csharp
builder.Host.UseWolverine(opts =>
{
    opts.UseRabbitMq(new Uri("amqp://localhost")).AutoProvision();

    opts.AddCritterWatchMonitoring("amqp://localhost", "my-service");
});

Full Options

cs
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
    );
});

snippet source | anchor

What AddCritterWatchMonitoring() Registers

Calling this method:

  1. Registers CritterWatchObserver as an IWolverineObserver singleton in the DI container
  2. Configures inbound command handling — registers Wolverine handlers for all 22+ inbound command types (replay, pause, rebuild, etc.)
  3. Sets up message routing — configures the transport queue for commands from CritterWatch and the publishing endpoint for telemetry
  4. 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.

csharp
// 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.

Released under the MIT License.