Skip to main content

How to alert on Temporal SDK Worker metrics

View Markdown

Temporal SDKs emit metrics from your Worker processes that expose failure modes the Temporal Service cannot see on your behalf: Workflow code that fails on replay, Workers that stop polling, Task slots that never free up, and Local Activities that outlive their heartbeat window.

This page recommends a set of alerts covering those failure modes, with a starting threshold for each. It applies to Workers connected to Temporal Cloud and to a self-hosted Temporal Service.

For metric definitions and label sets, see the Temporal SDK metrics reference. For Worker configuration guidance, see Worker deployment and performance.

Choose your thresholds

Every threshold on this page is a starting point, not a service level objective.

A high-throughput Task Queue, a latency-sensitive Namespace, and a bursty batch workload each want different values. Two things to tune per alert:

  • The threshold determines what counts as unhealthy. Set it against observed p99 during a known-good period, not against the value listed here.
  • The for duration determines how long the condition must hold before the alert fires. Shorter durations detect problems faster and fire more often on transient spikes. Longer durations suppress noise and delay detection.

Alerts on binary conditions — any occurrence of a gRPC status code, a gauge reaching zero — need no threshold tuning. Only the for duration matters, and only to filter out deploys and rolling restarts.

Request failures

These fire on gRPC responses from the Temporal Service to your Worker or Client. Triage guidance: SDK request failures.

Failure modeMetricThresholdSeverity
NOT_FOUND on respond operationstemporal_request_failureAny occurrenceCritical
NOT_FOUND on Activity heartbeattemporal_request_failureAny occurrenceWarning
RESOURCE_EXHAUSTED on user-facing operationstemporal_request_failureAny occurrenceCritical
RESOURCE_EXHAUSTED on respond operationstemporal_request_failureAny occurrenceCritical
UNIMPLEMENTED or INTERNAL from the Temporal Servicetemporal_request_failureAny occurrenceCritical
Request latency high on user-facing operationstemporal_request_latencyp99 above 2sCritical

Worker capacity

These fire when Workers stop keeping up with the Task Queue. Triage guidance: SDK Worker capacity.

Failure modeMetricThresholdSeverity
Worker Task slots exhaustedtemporal_worker_task_slots_availableReaches 0Critical
All pollers disconnectedtemporal_num_pollersReaches 0Critical
Task completions dropped to zerotemporal_requestRate reaches 0 per Task QueueCritical
Workflow Task schedule-to-start latency elevatedtemporal_workflow_task_schedule_to_start_latencyp99 above 5s, and again above 30mCritical
Activity schedule-to-start latency elevatedtemporal_activity_schedule_to_start_latencyp99 above 30mCritical
Sticky cache disabledtemporal_sticky_cache_sizeReaches 0Warning

Execution failures

These fire on Workflow and Activity code failing on the Worker. Triage guidance: SDK execution failures.

Failure modeMetricThresholdSeverity
Non-determinism errortemporal_workflow_task_execution_failedAny occurrenceCritical
gRPC message too largetemporal_workflow_task_execution_failedAny occurrenceCritical
Workflow Task execution failures elevatedtemporal_workflow_task_execution_failedRate above 10/sWarning
Workflow Task execution latency hightemporal_workflow_task_execution_latencyp99 above 10sCritical
Activity execution failures elevatedtemporal_activity_execution_failedRate above 10/sWarning
Local Activity latency exceeds the heartbeat timeouttemporal_local_activity_execution_latency, temporal_local_activity_total_execution_latencyp99 above 30mCritical

Set up the alerts

Before you can alert on these metrics, your Workers must be emitting them and your monitoring system must be scraping them:

Metric names vary by SDK and metrics reporter. Counters carry a _total suffix and histograms a _seconds_bucket suffix when scraped through Prometheus. The status_code label is PascalCase in the Go SDK (NotFound) and UPPER_SNAKE_CASE in the Java and Core SDKs (NOT_FOUND). Confirm the exact names in your own metrics endpoint before writing queries.

Route alerts by severity

Alerts marked Critical indicate that Workflow Executions are not progressing, or are progressing with data loss or duplicate side effects. Route these to a paging channel.

Alerts marked Warning indicate degradation that has not yet stopped progress: elevated failure churn, a misconfigured cache, an Activity heartbeat that is timing out and retrying. Route these to a review channel and address them before they escalate.

Several of these alerts have causal relationships — Task slots exhausted drives pollers to zero, which drives schedule-to-start latency up, which drives Task completions to zero. When multiple fire together, the triage pages identify which is the root cause and which are symptoms.