Skip to content

Wolverine.CritterWatch Overview

Wolverine.CritterWatch is the lightweight NuGet package installed in each service you want CritterWatch to monitor. It hooks into the Wolverine runtime using the IWolverineObserver extension point and continuously publishes telemetry to the CritterWatch server.

What It Does

The observer integrates with your service at the Wolverine runtime level — no changes to your handlers, aggregates, or domain logic are required. Once registered, it:

  1. Captures runtime events — node lifecycle, agent assignments, endpoint health, message store discovery
  2. Batches state snapshots — aggregates changes into a ServiceUpdates message every second
  3. Publishes to CritterWatch — sends batches over the configured transport (RabbitMQ, etc.)
  4. Handles inbound commands — responds to operator actions from the CritterWatch UI
  5. Performs health checks — actively probes agent health every 60 seconds and reports results

Architecture

CritterWatchObserver

The CritterWatchObserver class implements IWolverineObserver and receives callbacks for all Wolverine runtime events:

  • NodeStarted / NodeStopped — process node lifecycle
  • AgentStarted / AgentStopped — agent assignment changes
  • LeadershipAssumed — leadership election results
  • EndpointListened / EndpointStopped — listener lifecycle
  • CircuitBreakerTripped / CircuitBreakerReset — endpoint resilience events
  • BackPressureTriggered / BackPressureLifted — flow control events
  • ExceptionTriggered — message handler exceptions

In addition to reactive observation, the observer runs a periodic timer that:

  • Publishes a full state snapshot even when nothing has changed (heartbeat)
  • Performs active agent health checks using IAgentRuntime
  • Cleans up stale node records

ServiceUpdates Batch

Rather than publishing individual events, the observer batches all changes into a single ServiceUpdates message per second. This reduces network chattiness and allows CritterWatch to apply changes atomically.

A ServiceUpdates packet contains:

csharp
public record ServiceUpdates(
    string ServiceName,
    EndpointState[] Endpoints,
    MessagingSubscription[] Subscriptions,
    WolverineChange[] Changes,
    AgentHealthReport[] AgentHealth,
    PersistenceCounts PersistenceCounts
);

Capabilities Discovery

On first registration and whenever the runtime restarts, the observer discovers and reports:

  • All registered message types and their handler mappings
  • All messaging endpoints with their configuration
  • All Marten event stores and message stores
  • Multi-tenancy configuration (cardinality and tenant list)
  • Wolverine version string

This gives CritterWatch a complete picture of each service's topology without needing direct database or source code access.

Registration

See Registration for full configuration options.

Inbound Commands

See Inbound Commands for all 22+ commands CritterWatch can send.

Outbound Events

See Outbound Events for all 20+ event types services publish.

Released under the MIT License.