Table of Contents

Class AppMetrics

Namespace
Virtufin.WebSocketManager.Services
Assembly
Virtufin.WebSocketManager.dll

Application-level metrics for the WebSocketManager service. Mirrors the pattern in Virtufin.WorkManager.Services.AppMetrics. Counters are registered under the meter Virtufin.WebSocketManager, which is already wired into the OpenTelemetry pipeline in Program.cs.

public static class AppMetrics
Inheritance
AppMetrics
Inherited Members

Fields

DisconnectFailedPreconditionTotal

Total RpcException raised with StatusCode.FailedPrecondition from any RPC method. Tagged by method name. Increments unconditionally — even when the ownership-forward path catches the exception.

public static readonly Counter<long> DisconnectFailedPreconditionTotal

Field Value

Counter<long>

DisconnectForwardedTotal

Total RPC calls forwarded to the owning replica via Dapr service invocation. Tagged by method name. Stays at 0 when OWNERSHIP_MISS_FORWARD_THRESHOLD is 0 (default).

public static readonly Counter<long> DisconnectForwardedTotal

Field Value

Counter<long>

DisconnectOwnershipMissTotal

Total cross-instance ownership misses. Tagged by reason (not_owned when the local replica is not the owner, lapsed when the owner has dropped from knownInstances past INSTANCE_STALE_THRESHOLD_SECONDS). Paired with DisconnectForwardedTotal to measure how many misses were successfully forwarded to the owner replica.

public static readonly Counter<long> DisconnectOwnershipMissTotal

Field Value

Counter<long>

MeterName

public const string MeterName = "Virtufin.WebSocketManager"

Field Value

string

Methods

RecordFailedPrecondition(string)

Records a FailedPrecondition response with the originating method.

public static void RecordFailedPrecondition(string method)

Parameters

method string

RecordForwarded(string)

Records a successful owner-replica forward.

public static void RecordForwarded(string method)

Parameters

method string

RecordOwnershipMiss(bool)

Records a cross-instance ownership miss.

public static void RecordOwnershipMiss(bool ownerLapsed)

Parameters

ownerLapsed bool