Skip to content

Outbound Events

Outbound events are messages published by monitored services to the CritterWatch server. They flow from services → transport → CritterWatch, where they are handled and projected into Marten.

Most outbound events are wrapped in the ServiceUpdates batch and published on a 1-second timer. A few events (like HandlerSourceCodeResponse) are published on-demand in response to specific commands.

Primary Batch Event

ServiceUpdates

The main telemetry packet published every second:

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

The Changes array carries all state change events that occurred since the last publish.

Change Events (within ServiceUpdates)

AgentAndNodeStateChanged

Reports node and agent lifecycle events:

csharp
public record AgentAndNodeStateChanged(
    WolverineNode[] ActiveNodes,
    AgentAssignment[] Assignments,
    Guid? NewLeaderNodeId
);

AssignmentsChanged

Reports changes to agent-to-node assignments:

csharp
public record AssignmentsChanged(
    AgentAssignment[] Assignments,
    AgentReassignment[] Reassignments
);

BackPressureChanged

Reports back pressure activation or lifting:

csharp
// Two variants
public record BackPressureTriggeredMessage(string EndpointUri);
public record BackPressureLiftedMessage(string EndpointUri);

CircuitBreakerChanged

Reports circuit breaker state changes:

csharp
public record CircuitBreakerTrippedMessage(string EndpointUri, double FailureRate);
public record CircuitBreakerResetMessage(string EndpointUri);

EndpointHealthReport

Reports health of all transport endpoints:

csharp
public record EndpointHealthReport(
    EndpointHealthState[] States,
    TransportHealthState[] TransportStates
);

PersistenceCountsChanged

Reports inbox/outbox queue depths:

csharp
public record PersistenceCountsChanged(
    string? TenantId,
    long InboxCount,
    long OutboxCount,
    long ScheduledCount,
    long DeadLetterCount
);

ShardStatesChanged

Reports current projection shard state:

csharp
public record ShardStatesChanged(ShardStateSnapshot[] States);

public record ShardStateSnapshot(
    string ShardName,
    long CurrentSequence,
    long HighWaterMark,
    ShardExecutionMode Mode  // Continuous, Rebuilding, Rewinding, Paused
);

Capability Discovery Events

MessagingSubscription

Describes message types the service handles or publishes:

csharp
public record MessagingSubscription(
    string MessageTypeName,
    string? HandlerType,
    string? HandlerMethod,
    SubscriptionRole Role  // Handler, Publisher
);

MessageStoreDiscovered

Reports a discovered Wolverine message store:

csharp
public record MessageStoreDiscovered(
    string ServiceName,
    string DatabaseUri,
    MessageStoreType StoreType  // SqlServer, Postgresql, InMemory
);

MessageCausationDiscovered

Reports a runtime-discovered message causation (published-as-result-of relationship):

csharp
public record MessageCausationDiscovered(
    string ServiceName,
    string CausingMessageType,
    string ResultingMessageType
);

Health Report Events

AgentHealthReport

Reports health status for all agents:

csharp
public record AgentHealthReport(
    string ServiceName,
    AgentHealthEntry[] Agents
);

public record AgentHealthEntry(
    Uri AgentUri,
    AgentHealth Status,  // Healthy, Degraded, Offline
    string? StatusReason,
    DateTimeOffset Timestamp
);

Command Response Events

HandlerSourceCodeResponse

Response to RequestHandlerSourceCode:

csharp
public record HandlerSourceCodeResponse(
    string ServiceName,
    string MessageTypeName,
    string GeneratedSourceCode
);

RestartProjectionResult

Result of a projection restart or rebuild:

csharp
public record RestartProjectionResult(
    string ServiceName,
    string ShardName,
    bool Success,
    string? ErrorMessage
);

ScheduledMessageEdited

Confirms a scheduled message was successfully edited:

csharp
public record ScheduledMessageEdited(
    string ServiceName,
    Guid EnvelopeId,
    DateTimeOffset NewExecutionTime
);

StaleNodesEjected

Confirms stale node ejection:

csharp
public record StaleNodesEjected(
    string ServiceName,
    Guid[] EjectedNodeIds
);

SubscriptionOrProjectionRestarted

Reports automatic restart of a stalled projection or subscription:

csharp
public record SubscriptionOrProjectionRestarted(
    string ServiceName,
    string ShardName,
    string RestartReason,
    DateTimeOffset Timestamp
);

TenantListResponse

Response to RequestTenantList:

csharp
public record TenantListResponse(
    string ServiceName,
    TenantInfo[] Tenants
);

public record TenantInfo(
    string TenantId,
    TenantStatus Status  // Active, Disabled
);

Released under the MIT License.