Trama

Observability

Track Trama runtime health with Prometheus metrics, Grafana dashboards, and OpenTelemetry traces across queue claims, failures, latency, and Redis shard ownership. Use this page when you need to answer “is the orchestrator healthy?” and “where are workflows getting stuck?”

Best for SREs Metrics and tracing Production operations

What you can answer with this data

Use Trama observability to answer whether workflows are flowing through the queue, whether failures are climbing, whether Redis shard ownership is healthy, and whether end-to-end latency is staying within expectations.

Metrics Catalog

MetricTypeDescription
saga_enqueue_totalCounterQueue ingress
saga_dequeue_totalCounterQueue claims
saga_processed_totalCounterProcessed outcomes
saga_failed_totalCounterFailures by reason
saga_retried_totalCounterRetry scheduling rate
saga_rate_limited_totalCounterRate-limited executions
saga_redis_claim_scans_totalCounterRedis shard claim scans. Since 2.1.0, claimers only visit shards with due work, so this tracks real work rather than idle polling.
saga_redis_errors_totalCounterRedis calls that failed in a background loop and were retried with backoff, by operation (since 2.1.0)
saga_fenced_totalCounterWork dropped because the worker no longer owned it, by reason: lease_lost (paused past its claim lease) or stale_checkpoint (another copy got ahead). Since 2.1.0.
saga_reconciled_totalCounterExecutions re-sent from their Postgres checkpoint after their queue item was lost, by status (since 2.1.0)
saga_inmemory_queue_sizeGaugeExecutions claimed by this process and waiting for a free worker
saga_redis_active_podsGaugeHealthy worker pods seen in Redis membership.
saga_redis_owned_shardsGaugeVirtual shards currently assigned to this worker.
saga_redis_membership_refresh_age_msGaugeAge of the last successful membership refresh.
saga_duration_secondsHistogramEnd-to-end duration
saga_step_duration_success_secondsHistogramDuration of successful task HTTP calls, by step_name
saga_node_duration_secondsHistogramPer-node dispatch duration: the HTTP call for tasks (until accepted for async), condition evaluation for switches, parking for sleeps, fan-out for splits (since 2.0.1)
saga_callback_received_totalCounterAsync callbacks delivered to the orchestrator
saga_callback_rejected_totalCounterAsync callbacks rejected (expired, bad signature, replay, attempt mismatch)
saga_callback_timeout_totalCounterAsync tasks that timed out waiting for a callback
saga_callback_wait_entered_totalCounterAsync tasks that started waiting for a callback
saga_callback_timeout_scan_requeued_totalCounterTimed-out waits re-enqueued by the callback timeout scanner
saga_switch_evaluated_totalCounterSwitch node evaluations

The Redis cluster rollout adds worker-coordination metrics so you can observe shard ownership, claim pressure, and membership freshness without inspecting Redis directly.

Definition-Level Labels

Grafana Dashboard

Import grafana/trama-saga-dashboard.json.

Suggested Alerts

Logs

Logs are structured JSON (logstash encoder) with the execution id and trace context in the MDC. Since 2.2.0, INFO carries one line per execution, saga finished, with status and durationMs, plus lifecycle events: retries, compensation, sleeps, callback waits and timeouts. The per-node lines (executing node, node completed) are at DEBUG; a failed node still logs node completed at INFO.

Health probes

Tracing

OpenTelemetry spans cover request handling and saga processing when telemetry is enabled.