Observability
The API server uses Uber Zap (go.uber.org/zap) for structured JSON logging. Verified at cmd/server/main.go:27 (logger, _ := zap.NewProduction()).
14.8.1 Log levels
Set with LOG_LEVEL=debug|info|warn|error.
14.8.2 Health probes
Two HTTP endpoints (handlers in internal/handler/health.go):
Map these to Kubernetes:
14.8.3 Metrics
VERIFY: confirm whether the API exposes a Prometheus
/metricsendpoint. If present, recommended scrape:
Recommended dashboards:
- Request rate / status / latency (RED method) —
http_requests_total,http_request_duration_seconds, bypath,method,status. - Database pool — open / idle / in-use connections.
- Redis — command rate, keyspace size, evictions.
- Chain client — RPC call rate, RPC error rate, mean tx confirmation time.
- Auth funnel — OTP issued / verified / failed; refresh token rotated / replayed.
14.8.4 Log shipping
JSON logs to stdout — pipe into:
- Cluster: Fluent Bit / Vector → Loki / Elasticsearch / OpenSearch.
- Single-host:
docker compose logs→journaldor files mounted at/var/log/ida/.
Required fields to keep searchable: request_id, auth_subject, auth_role, path, status, latency_ms.
14.8.5 Tracing
Recommended (not yet wired): OpenTelemetry — wrap Chi router with otelhttp.NewMiddleware. Propagate traceparent from clients (Portal already sets X-Request-Id).
VERIFY: OTel integration status in
pkg/telemetry/.