Observability
Use the Kubernetes API to check a stack’s current state, logs to investigate decisions and failures, and metrics to monitor stacks over time.
| Signal | Where to look | What it tells you |
|---|---|---|
| Status and events | kubectl describe iacstack, kubectl get iacstack -o yaml | Which generation did the controller observe? Which attempt is recorded? Why is reconciliation waiting, blocked, or failed? |
| Controller JSON logs | IaC Stack Controller Pod stdout | What happened during reconciliation, execution registration, or authorization? Correlate by stack and namespace, and by workflow or intentHash when present. |
| Pipeline logs and artifacts | Argo UI or Workflow Pods | What did Terraform or OpenTofu, the backend, or the policy step report? |
| Metrics | GET /metrics on the controller, port 8080 | How many attempts are active? Which stacks have outstanding drift? How long do attempts take? |
To trace one stack across these signals, use the troubleshooting guide.
Check metrics and process health
To inspect one replica locally, forward the Deployment ports.
kubectl -n platform-system port-forward deployment/iacstack-controller 18080:8080 18081:8081
In a second terminal:
curl -fsS http://127.0.0.1:18080/metrics | grep '^iacstack_'
curl -fsS http://127.0.0.1:18081/healthz
curl -fsS http://127.0.0.1:18081/readyz
The probes report process health. To verify stack convergence, check the generation and conditions on the CR. Some counters appear after the process observes the first matching transition.
| Controller metrics | What they measure |
|---|---|
iacstack_condition, iacstack_execution_phase | Persisted condition and phase by stack. The current series has a value of 1. |
iacstack_execution_active, iacstack_suspended, iacstack_observed_generation_current | An unfinished recorded attempt, a suspended stack, and status for the current generation. Confirm Pod activity in Argo. |
iacstack_drift_pending, iacstack_last_drift_timestamp_seconds | Reported drift without confirmed convergence and the last detection time. A missing drift series means the state is unknown. |
iacstack_last_check_timestamp_seconds, iacstack_last_success_timestamp_seconds, iacstack_execution_scheduled_timestamp_seconds, iacstack_retry_attempts | Last completed attempt, last Ready result, scheduling time for the recorded attempt, and its retry number. |
iacstack_active_executions, iacstack_blocked_executions, iacstack_resource_health_available | Cache totals for unfinished attempts and stacks with ReconcileBlocked on the current generation, plus cache read availability. |
iacstack_executions_total, iacstack_contract_errors_total, iacstack_drift_detected_total, iacstack_retries_total, iacstack_authorization_requests_total | Local counters for persisted transitions observed by the process. The authorization counter records observed grants, and counters reset with the process. |
iacstack_execution_duration_seconds | Histogram from scheduling through completion, including approval waits. |
Integrate with your platform
Configure Prometheus or a compatible collector to scrape /metrics on port 8080 of each controller Pod. Use Pod discovery or a ServiceMonitor with a Service and an existing Prometheus Operator installation. The base installation provides the endpoint, JSON logs on stdout, and Events in the Kubernetes API. Configure collection, retention, dashboards, and alerts in your platform.
Per-stack gauges have namespace and stack labels. The examples below filter to replicas with a readable cache and use max to avoid counting the same stack twice. They assume the scrape preserves shared job and instance labels across the controller metrics. Scope queries to the installation’s cluster and job when the backend receives metrics from several clusters.
max by (namespace, stack, reason) (
iacstack_condition{condition="Failed"}
and on (job, instance) (iacstack_resource_health_available == 1)
)
max by (namespace, stack) (
iacstack_drift_pending
and on (job, instance) (iacstack_resource_health_available == 1)
) == 1
To alert on long-running attempts, compute age from the scheduling timestamp only while iacstack_execution_active is 1. Choose a threshold that accounts for expected approval times. To investigate internal errors without a persisted status change, check the controller logs and controller-runtime reconciliation metrics. Use the CR condition and Workflow to confirm incidents when the replicas temporarily disagree.
Collect logs from controller and runner Pods in your cluster log backend and preserve namespace and Pod name at ingestion. The controller defaults to the info level. To investigate a contract or reconciliation issue, temporarily set --zap-log-level=debug in the Deployment through the mechanism that manages your installation, then restore info.