Skip to main content
Temporal Server provides comprehensive monitoring capabilities through metrics, structured logging, and distributed tracing to observe cluster health and performance.

Metrics Collection

Temporal emits metrics using either Prometheus or StatsD backends. The metrics framework can be configured to use either Tally or OpenTelemetry.

Prometheus Configuration

Configure Prometheus metrics in your config.yaml:
Framework Options:
  • tally - Legacy framework using uber-go/tally
  • opentelemetry - Modern OpenTelemetry-based metrics (recommended)
Configuration Fields:
  • listenAddress - Address where Prometheus scrapes metrics
  • handlerPath - HTTP endpoint path (default: /metrics)
  • loggerRPS - Rate limit for metric logger (0 = unlimited)

StatsD Configuration

For StatsD integration:
Configuration Fields:
  • hostPort - StatsD server address
  • prefix - Metric name prefix
  • flushInterval - Batch flush interval (default: 1s)
  • flushBytes - Maximum UDP packet size (default: 1432)
  • tagSeparator - Character to separate tags (optional)

Common Metrics Configuration

Options:
  • tags - Global tags added to all metrics
  • excludeTags - Filter sensitive tag values (replaced with _tag_excluded_)
  • prefix - Prefix for all metric names
  • perUnitHistogramBoundaries - Custom histogram buckets by unit type
  • withoutUnitSuffix - Remove unit suffixes (OpenTelemetry only)
  • withoutCounterSuffix - Remove _total suffix from counters (OpenTelemetry only)
  • recordTimerInSeconds - Emit timers in seconds instead of milliseconds

Key Metrics by Service

Service Health Metrics

These metrics track overall service health:
Common Tags:
  • operation - API method name
  • service_role - Service type (frontend, history, matching, worker)

Persistence Layer Metrics

Track database operations:
Each persistence operation emits:
  • Request count
  • Error count
  • Latency histogram
  • db_kind tag (cassandra, mysql, postgres, sqlite)

History Service Metrics

Matching Service Metrics

Authorization Metrics

Tagged with:
  • namespace - Target namespace
  • operation - API being authorized

Error Tracking

Error metrics by type:

Resource Metrics

Lock and Semaphore Usage

Cache Metrics

Tagged with cache_type:
  • mutablestate
  • events
  • version_membership
  • routing_info

TLS Certificate Monitoring

Configure certificate monitoring:

Alerting Guidelines

Critical Alerts

Set up alerts for:
  1. Service Availability
  2. Persistence Layer
  3. Shard Health
  4. Certificate Expiration

Warning Alerts

  1. High Latency
  2. Resource Pressure
  3. Cache Efficiency

Logging Configuration

Configure structured logging:
Log Levels:
  • debug - Detailed diagnostic information
  • info - General operational events
  • warn - Warning messages, degraded state
  • error - Error events, requires attention
Important Log Tags:
  • namespace - Namespace name
  • workflowID - Workflow execution ID
  • runID - Workflow run ID
  • operation - Operation being performed
  • error - Error details
  • shard-id - History shard ID

Health Checks

Temporal exposes health check endpoints:

Distributed Tracing

Enable OpenTelemetry tracing:
Tracing captures:
  • Request flow across services
  • Persistence operation timing
  • Cross-namespace operations
  • Replication latency

Dashboard Recommendations

Service Overview Dashboard

  • Request rate by service and operation
  • Error rate and types
  • Latency percentiles (p50, p95, p99)
  • Active connections

Persistence Dashboard

  • Operation latency by type
  • Error rates by operation
  • Connection pool utilization
  • Query duration

Workflow Execution Dashboard

  • Workflow start rate
  • Workflow completion rate
  • Task queue backlog
  • Activity timeouts

Resource Usage Dashboard

  • CPU and memory per service
  • Lock contention
  • Cache hit rates
  • GC pause time

See Also