Skip to content

Configuration Reference

Monitored Service Configuration

AddCritterWatchMonitoring()

Call this inside UseWolverine() in each service you want to monitor.

Simple form — URI and service name:

csharp
opts.AddCritterWatchMonitoring(
    "amqp://localhost",   // RabbitMQ URI (or other transport)
    "my-service-name"     // Unique service name
);

Full options form:

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

Options Reference

OptionDefaultDescription
RabbitMqUriURI of the RabbitMQ broker (or transport endpoint)
ServiceNameUnique identifier for this service in CritterWatch
LabelServiceNameDisplay name shown in the UI
HeartbeatInterval1 secondHow often state snapshots are published
AgentHealthCheckInterval60 secondsHow often agent health is actively checked
configureBaselines(none)Optional callback to declare expected throughput/execution-time baselines for this service. See Alerts › Editing Thresholds.

Service Name Must Be Unique

The ServiceName is used as the Marten event stream key. Two services with the same name will overwrite each other's state. Use a name that uniquely identifies the service across your entire deployment.

CritterWatch Server Configuration

AddCritterWatch()

cs
var builder = WebApplication.CreateBuilder(args);

builder.AddCritterWatch(
    builder.Configuration.GetConnectionString("critterwatch")!,
    opts =>
    {
        opts.UseRabbitMq(new Uri("amqp://localhost")).AutoProvision();
        opts.ListenToRabbitQueue("critterwatch").Sequential();
    });

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

UseCritterWatch()

Maps all CritterWatch middleware into the ASP.NET Core pipeline:

csharp
app.UseCritterWatch();

// Or with a custom SignalR route:
app.UseCritterWatch(signalRRoute: "/my-hub");

UseCritterWatch() registers:

  • Wolverine HTTP endpoints under /api/critterwatch/*
  • SignalR hub at /api/messages (configurable)
  • Static file serving for the embedded Vue SPA
  • Client-side routing fallback for the SPA

Docker Compose

A complete docker-compose.yml for local development:

yaml
services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: critterwatch
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  rabbitmq:
    image: rabbitmq:3-management
    ports:
      - "5672:5672"    # AMQP
      - "15672:15672"  # Management UI
    environment:
      RABBITMQ_DEFAULT_USER: guest
      RABBITMQ_DEFAULT_PASS: guest

volumes:
  postgres_data:

Connection String Formats

PostgreSQL

Host=localhost;Port=5432;Database=critterwatch;Username=postgres;Password=postgres

For cloud providers:

Host=my-postgres.postgres.database.azure.com;Database=critterwatch;Username=app@my-postgres;Password=secret;SSL Mode=Require

RabbitMQ

amqp://guest:guest@localhost:5672/
amqps://user:pass@my-rabbit.cloud:5671/  # TLS

appsettings.json

The recommended approach for managing connection strings:

json
{
  "ConnectionStrings": {
    "critterwatch": "Host=localhost;Database=critterwatch;Username=postgres;Password=postgres",
    "rabbitmq": "amqp://localhost"
  }
}
csharp
builder.AddCritterWatch(
    builder.Configuration.GetConnectionString("critterwatch")!,
    opts =>
    {
        var rabbitUri = new Uri(
            builder.Configuration.GetConnectionString("rabbitmq")!);
        opts.UseRabbitMq(rabbitUri).AutoProvision();
        opts.ListenToRabbitQueue("critterwatch").Sequential();
    });

Alert thresholds

Most alert thresholds are tuned in the UI rather than in configuration files — see Alert Configuration for the live preview, history tab, and three-level cascade (global → per-service → per-message-type).

Defaults that ship with the console:

ThresholdDefault
DLQ count Warning / Critical10 / 100
Projection lag Warning / Critical30s / 300s
Agent unhealthy Warning / Critical2 / 5 consecutive checks
DLQ rate / hour Warning / Critical10 / 50
Failure rate Warning / Critical5% / 20%
Throughput multiplier Warning / Critical3× / 10× of baseline
Exec time Warning / Critical+50% / +200% over baseline

For services that need different defaults baked in (rather than tuned post-deploy), declare baselines from AddCritterWatchMonitoring — see Registration → Declared Baselines.

Released under the MIT License.