Skip to content

Monitoring & Observability

Health Endpoints

All health and metrics endpoints are unauthenticated. Gate /metrics at the network level (firewall, security group, or internal-only bind) so it is not reachable from the public internet.

EndpointPurposeAuth
GET /liveLiveness only — no dependency checksNone
GET /readyReadiness with dependency checksNone
GET /healthReadiness (alias for /ready)None
GET /api/v1/readinessReadiness (alias for /ready)None
GET /metricsPrometheus-format metrics (primary scrape target)None (network-gate it)
GET /debug/varsexpvar metrics (secondary)None

Liveness

sh
curl http://localhost:8080/live

Returns 200 OK if the HTTP server is running. Use this for container liveness probes — it does not check downstream dependencies, so a wedged database connection will not cause restarts.

Readiness

sh
curl http://localhost:8080/ready

Returns JSON with dependency connectivity (PostgreSQL, Valkey, RabbitMQ). /health and /api/v1/readiness are aliases that return the same response. Use one of these for load balancer health checks and Kubernetes readiness probes.

Metrics

All metrics are exposed in Prometheus format at /metrics (the primary scrape target for Prometheus). The same metrics are also available in expvar format at /debug/vars as a secondary endpoint. Both endpoints are unauthenticated — restrict access at the network level.

Correlator Metrics

MetricDescription
alga_correlator_alerts_totalTotal alerts received
alga_correlator_alerts_merged_totalAlerts merged into existing windows
alga_correlator_published_totalInvestigations published after correlation
alga_correlator_dropped_totalAlerts dropped
alga_correlator_fail_closed_totalFail-closed events
alga_correlator_windows_opened_totalNew correlation windows opened
alga_correlator_flushes_totalWindows flushed (expired)

Scheduler Metrics

MetricDescription
alga_scheduler_pendingCurrent pending investigation depth
alga_scheduler_online_agentsAgents currently online (all replicas)
alga_scheduler_agent_capacity_usedAggregate used capacity
alga_scheduler_agent_capacity_totalAggregate total capacity
alga_scheduler_scheduled_totalSuccessful investigation binds
alga_scheduler_no_candidate_totalPending with no eligible agent
alga_scheduler_bind_failed_totalAtomic claim or forward failures
alga_scheduler_skip_backoff_totalSkipped due to failure backoff
alga_scheduler_tick_totalTotal scheduler ticks
alga_scheduler_tick_duration_msLast tick duration
alga_scheduler_is_leader1 on leader replica, 0 elsewhere
alga_scheduler_stale_alerts_sweptUninvestigated alerts found per sweep
alga_scheduler_stale_investigations_createdInvestigations from stale alerts
alga_scheduler_stale_sweep_tick_totalTotal stale sweep ticks
alga_scheduler_nudge_totalScheduler nudge events

Webhook Metrics

MetricDescription
alga_webhook_alert_publish_queued_totalWebhook alerts queued for publishing
alga_webhook_alert_publish_sync_fallback_totalWebhook alerts published via sync fallback
alga_webhook_alert_publish_sync_processed_totalWebhook alerts processed synchronously

Escalation Metrics

MetricDescription
alga_escalations_fired_totalTotal escalations fired
alga_sla_breach_response_totalSLA response time breaches
alga_sla_breach_resolve_totalSLA resolution time breaches

Incident Metrics

MetricDescription
alga_incidents_created_totalTotal incidents created
alga_incidents_activeCurrently active incidents
alga_incidents_resolved_totalTotal incidents resolved
alga_incidents_mitigated_totalTotal incidents mitigated
alga_incidents_closed_totalTotal incidents closed
alga_incidents_cancelled_totalTotal incidents cancelled
alga_incidents_reopened_totalTotal incidents reopened

Triage Metrics

MetricDescription
alga_triage_totalTotal triage evaluations
alga_triage_decision_*Per-decision outcome counters
alga_triage_confirmed_totalTriage decisions confirmed
alga_triage_overridden_totalTriage decisions overridden
alga_triage_short_circuit_totalTriage evaluations short-circuited
alga_triage_llm_totalLLM-based triage evaluations
alga_triage_llm_duration_msLLM triage duration

Playbook Metrics

MetricDescription
alga_playbooks_matched_totalPlaybooks matched to investigations
alga_playbooks_steps_completed_totalPlaybook steps completed

ICS Metrics

MetricDescription
alga_ics_roles_assigned_totalICS roles assigned
alga_ics_handoffs_totalIC handoffs performed

Handoff Metrics

MetricDescription
alga_oncall_handoffs_totalOn-call handoffs
alga_oncall_handoffs_acknowledged_totalHandoffs acknowledged
alga_oncall_reminders_sent_totalOn-call reminders sent

Prometheus Integration

Scrape the /metrics endpoint with Prometheus:

yaml
scrape_configs:
  - job_name: 'alga'
    static_configs:
      - targets: ['alga:8080']
    metrics_path: '/metrics'
    scrape_interval: 15s

Grafana Dashboard

Import deploy/grafana/alga-dashboard.json into Grafana for a pre-built monitoring dashboard with panels for:

  • Alert ingestion rate
  • Correlation window activity
  • Scheduler bind rate and latency
  • Agent online count and capacity
  • Investigation lifecycle (pending → complete → failed)
  • SLA breach rate

OpenTelemetry Tracing

Alga exports distributed traces via OTLP/HTTP when tracing is enabled. Tracing activates when ALGA_OTEL_ENABLED=true or when an OTLP endpoint is configured.

VariableDescription
ALGA_OTEL_ENABLEDSet to true to enable trace export
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint (a gRPC :4317 endpoint is rewritten to :4318 for HTTP export)
ALGA_OTEL_SAMPLE_RATIOSampling ratio for the ParentBased(TraceIDRatioBased) sampler (0.0–1.0)

Cross-Broker Trace Propagation

Trace context propagates across the RabbitMQ broker boundary using W3C traceparent/tracestate headers injected into AMQP message headers (rabbitmq/trace_carrier.go). This means a trace started at the webhook or API layer continues through correlation, scheduling, and investigation workers as a single distributed trace.

Request ID Correlation

Every HTTP request passes through a request ID middleware that:

  • Reads an incoming X-Request-ID header (or generates one if absent)
  • Echoes it back in the response X-Request-ID header
  • Attaches it to the structured logger context so all log lines for that request share the same ID

Use the request ID to correlate client-side errors with backend log entries.

Logging

Configuration

sh
LOG_LEVEL=info                      # debug, info, warn, error, fatal
LOG_FORMAT=json                     # text (default) or json
LOG_FILE=/var/log/alga/app.log      # Optional file output

The Docker Compose deployment sets LOG_FORMAT=json for structured log ingestion.

Log Levels

LevelUse Case
debugDevelopment, troubleshooting
infoNormal operations (default)
warnRecoverable issues
errorFailures requiring attention
fatalUnrecoverable, process exits

Viewing Logs

sh
# Docker Compose
docker compose logs -f backend

# Direct
LOG_LEVEL=debug ./alga

The log level can also be changed at runtime without a restart via the System Configuration API (PUT /api/v1/system/config with log_level).

Alerting on Alga Itself

Monitor these indicators to detect Alga issues:

IndicatorThresholdAlert
alga_scheduler_bind_failed_total increasing> 0 sustainedAgent dispatch failing
alga_correlator_dropped_total increasing> 0Alerts being dropped
Readiness endpoint returns errorsAnyBackend unhealthy
alga_scheduler_pending growingSustained growthInvestigations backing up
alga_scheduler_no_candidate_total growing> 0No agents online

See Also

Released under the MIT License.