Skip to content

Telemetry

Arnel Robles edited this page Sep 29, 2026 · 1 revision

Telemetry

Hooks (Carom)

CaromHooks has four process-wide delegates:

Hook Payload Raised when
OnRetry RetrySignal: Attempt (1 for the first retry), Delay, ExceptionTypeName (null for a result retry) A retry is about to wait
OnCircuitOpened CircuitOpenedSignal: ServiceKey A closed circuit opens, once per transition
OnBulkheadRejected BulkheadRejectedSignal: ResourceKey A full bulkhead turns a call away
OnRateLimitRejected RateLimitRejectedSignal: ServiceKey A throttle has no token
CaromHooks.OnRetry += s => logger.LogWarning("retry {Attempt} in {Delay}", s.Attempt, s.Delay);

Handlers run synchronously on the calling thread, so keep them fast. An exception thrown by a handler is caught and dropped so it cannot break the call it observes. With no handler set, nothing is computed or allocated.

OpenTelemetry (Carom.Telemetry.OpenTelemetry)

using Carom.Telemetry.OpenTelemetry;

CaromTelemetry.Subscribe();

builder.Services.AddOpenTelemetry()
    .WithMetrics(m => m.AddMeter(CaromTelemetry.MeterName));

Subscribe wires the hooks to these instruments on the Carom meter. It is safe to call more than once, and Unsubscribe removes exactly what it added.

Instrument Type Tags
carom.retry.count counter attempt, exception_type
carom.retry.delay histogram, ms none
carom.circuit_breaker.open.count counter service
carom.bulkhead.rejection.count counter resource
carom.rate_limit.rejection.count counter service

CaromTelemetry.StartActivity starts an activity on the Carom activity source for your own spans. Carom does not create spans on its own.

Clone this wiki locally