Skip to content

Quick Start

This guide walks through connecting a Wolverine service to CritterWatch and opening the monitoring console for the first time.

Step 1: Start Infrastructure

Create or update your docker-compose.yml:

yaml
services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: critterwatch
    ports:
      - "5432:5432"

  rabbitmq:
    image: rabbitmq:3-management
    ports:
      - "5672:5672"
      - "15672:15672"
bash
docker compose up -d

Step 2: Add Monitoring to Your Service

In each Wolverine service you want to monitor, install the package:

bash
dotnet add package Wolverine.CritterWatch

Then call AddCritterWatchMonitoring() inside your UseWolverine() configuration:

cs
var builder = WebApplication.CreateBuilder(args);

builder.Host.UseWolverine(opts =>
{
    // Configure the transport your service already uses
    opts.UseRabbitMq(new Uri("amqp://localhost"))
        .AutoProvision();

    // Send telemetry to the CritterWatch server queue
    // and listen for incoming commands on the service control URI
    opts.AddCritterWatchMonitoring(
        critterWatchUri: new Uri("rabbitmq://critterwatch"),
        systemControlUri: new Uri("rabbitmq://trip-service-control")
    );
});

var app = builder.Build();
app.Run();

snippet source | anchor

TIP

The AddCritterWatchMonitoring() call must come after your transport configuration (e.g., UseRabbitMq) so the observer can use the transport to publish telemetry.

Step 3: Create the CritterWatch Server

Create a new ASP.NET Core project for the CritterWatch console:

bash
dotnet new web -n MyCritterWatch
cd MyCritterWatch
dotnet add package CritterWatch

Configure it in Program.cs:

cs
var builder = WebApplication.CreateBuilder(args);

// Register CritterWatch services with your PostgreSQL connection string
builder.AddCritterWatch(
    "Host=localhost;Database=critterwatch;Username=postgres;Password=postgres",
    opts =>
    {
        // Configure the transport CritterWatch uses to communicate with services
        opts.UseRabbitMq(new Uri("amqp://localhost"))
            .AutoProvision();
        opts.ListenToRabbitQueue("critterwatch").Sequential();
    });

var app = builder.Build();

// Maps HTTP endpoints, SignalR hub, and serves the embedded SPA
app.UseCritterWatch();

app.Run();

snippet source | anchor

Step 4: Run Everything

Start your monitored service(s) and the CritterWatch server:

bash
# Terminal 1: your service
cd MyService
dotnet run

# Terminal 2: CritterWatch
cd MyCritterWatch
dotnet run

Step 5: Open the Console

Navigate to http://localhost:5000 (or whatever port your CritterWatch server runs on). You should see:

  1. The CritterWatch dashboard with your service listed
  2. Live health indicators updating in real time
  3. Node, agent, and endpoint status

Within a few seconds of starting your monitored service, it will appear in the Services view with its name, version, and current health status.

For development, .NET Aspire provides the best experience. It orchestrates all services and automatically wires up the frontend dev server:

csharp
// In your AppHost Program.cs
var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres");
var rabbit = builder.AddRabbitMQ("rabbit");

// Your monitored services
var tripService = builder.AddProject<Projects.TripService>("trip-service")
    .WithReference(postgres)
    .WithReference(rabbit);

// CritterWatch server
var critterwatch = builder.AddProject<Projects.CritterWatchBff>("critterwatch")
    .WithReference(postgres)
    .WithReference(rabbit)
    .WaitFor(tripService);

builder.Build().Run();
bash
cd src/BffHost
dotnet run

The Aspire dashboard will show all services, and you can navigate to CritterWatch via the resource links.

Next Steps

Released under the MIT License.