DocsOperationsObservability

Observability

OpenTelemetry signals and LGTM dashboards.

Chronoverse emits OpenTelemetry traces, metrics, and structured logs to the bundled Grafana OTEL LGTM stack.

Collection

Services and workers export over OTLP gRPC to lgtm:4317. The Grafana UI is available inside the lgtm container on port 3000, but is not host-published by default. Anonymous access is disabled (GF_AUTH_ANONYMOUS_ENABLED=false); authenticate with GF_SECURITY_ADMIN_USER / GF_SECURITY_ADMIN_PASSWORD.

Grafana access

For Kubernetes, use kubectl -n chronoverse port-forward svc/lgtm 3000:3000. For Compose, use the opt-in loopback override:

docker compose -f compose.dev.yaml -f compose.grafana.yaml up -d lgtm

compose.grafana.yaml publishes 127.0.0.1:${GRAFANA_HOST_PORT:-3000}:3000; it does not expose Grafana to the LAN.

To rotate the Compose administrator password, update GF_SECURITY_ADMIN_PASSWORD, recreate lgtm with the same administrator username, and apply the password to Grafana's database:

docker compose -f compose.dev.yaml up -d --force-recreate --no-deps lgtm
scripts/grafana/reset-admin-password.sh

The helper uses Grafana CLI, passes the password through standard input, and verifies anonymous requests return 401 and configured credentials return 200. Preserve lgtm:/data: it contains the Grafana database and dashboards, Prometheus metrics, Loki logs, Tempo traces, and Pyroscope profiles.

Built-in dashboard

Every environment file-provisions a chronoverse Grafana dashboard from infra/k8s/base/grafana-dashboards/chronoverse.json (Compose bind-mounts the directory; Kubernetes serves it from hashed ConfigMaps that Grafana re-polls every 30 seconds). It covers HTTP/gRPC request rates, p95 latency, latency heatmaps, 5xx ratios, Go runtime (goroutines, memory, CPU), log volume and error logs, and a fleet table, with links into Explore for traces and logs. The LGTM image's bundled demo dashboards are disabled by an empty provider (defaults-off.yaml) because provisioned dashboards cannot be removed through the Grafana UI.

Traces

Trace context crosses HTTP, gRPC, and Kafka. Use a single trace to follow an API mutation into outbox publication, worker processing, domain RPCs, and follow-up events.

Metrics

Runtime and host metrics complement application spans. HTTP, gRPC, and Redis instrumentation uses the same global OpenTelemetry meter provider and exports through the configured OTLP endpoint.

Endpoint metrics

The HTTP server emits the standard OpenTelemetry histograms:

  • http.server.request.duration
  • http.server.request.body.size
  • http.server.response.body.size

Outbound heartbeat requests emit the corresponding http.client.* metrics. HTTP server metrics use route templates such as /workflows/{workflow_id}; workflow IDs, job IDs, users, URLs, and authentication data are not metric attributes.

All gRPC servers and clients emit:

  • rpc.server.call.duration and rpc.client.call.duration
  • per-RPC request and response message counts

Useful dimensions include HTTP method, route, and response status, plus gRPC service, method, and status code. Unary and streaming RPCs are both recorded.

Request volume is derived from histogram sample counts rather than a separate request counter. In Grafana's Prometheus data source, the OTEL metrics are normalized to Prometheus names. Example queries include:

# REST requests per second by route and method
sum by (http_route, http_request_method) (
  rate(http_server_request_duration_seconds_count[5m])
)
 
# REST 5xx ratio
sum(rate(http_server_request_duration_seconds_count{http_response_status_code=~"5.."}[5m]))
/
sum(rate(http_server_request_duration_seconds_count[5m]))
 
# REST p95 latency by route
histogram_quantile(
  0.95,
  sum by (le, http_route) (rate(http_server_request_duration_seconds_bucket[5m]))
)
 
# gRPC requests per second by service and method
sum by (rpc_service, rpc_method) (
  rate(rpc_server_call_duration_seconds_count[5m])
)

Watch latency distributions, error ratios, and saturation rather than relying only on process uptime.

Durable cleanup metrics

Jobs-service exports cleanup backlog gauges from committed PostgreSQL state:

OTLP metricMeaning
chronoverse.container_cleanup.outstandingAll unfinished container cleanup, including quarantined work and dead publication
chronoverse.container_cleanup.quarantinedExecution quarantines requiring operator repair and redrive
chronoverse.container_cleanup.publication_deadUnfinished cleanup whose outbox publication is DEAD
chronoverse.container_cleanup.oldest_dueSeconds overdue for cleanup execution, excluding active cleanup leases, future execution backoff and quarantined work

oldest_due follows execution eligibility, not the next republication deadline. A delivery already in Kafka can execute while its next replay is scheduled for later. Replay pacing does not pause or reset this age; execution leases and execution retry backoff do. This keeps stalled cleanup visible during a long replay interval. If no usable delivery remains in Kafka, execution may depend on the next eligible replay. Check its due time, publication state and consumer progress alongside this gauge when diagnosing overdue cleanup.

These are gauges of retained work, not counts of deliveries or log lines. Duplicate delivery and exporter restarts do not increase the backlog. A matching completion receipt removes the cleanup from every measurement. No job, container, runtime or actor identity is exported as a metric label.

Every jobs-service replica reads the same database totals. Aggregate replicas with max, not sum. Collection has a five-second deadline and honors an earlier caller deadline. A failed collection omits samples rather than reporting a healthy zero; monitor telemetry availability separately.

See monitoring for alert interpretation and recovery for diagnosis, redrive and audit history. These signals are available through the existing telemetry pipeline; the built-in request/runtime dashboard does not provision cleanup-specific panels or alerts.

Cleanup metric definitions and collectioninternal/repository/jobs/cleanup_metrics.go

Durable discovery metrics

Jobs-service exports discovery backlog gauges from committed intent state:

OTLP metricMeaning
chronoverse.container_intents.discovery_due{lane}Closed, non-quarantined intents scheduled due, split by URGENT and SURVEILLANCE
chronoverse.container_intents.oldest_due{lane}Seconds since the oldest scheduled due time in that lane, including due rows that still hold an inspection lease
chronoverse.container_intents.quarantinedQuarantined intents requiring repair before redrive
chronoverse.container_intents.capacity_holdsUnreleased Start-reserved capacity holds

A successful read always reports both lanes, with an explicit zero for an empty lane, and never an unlabeled total beside them. Lane is the only attribute; no job, intent or runtime identity is exported. Scheduled-due age is not claimable waiting age because a due row can still hold its 45-second inspection lease, so inspect active leases separately and compare the maximum lane age.

The marker is a conservative scheduling hint, not proof, admission or mutation authority. First closure starts in the urgent lane at closure time, a duplicate closure preserves the marker and due time, a new unreceipted materialization promotes, and only a successful fenced report may downgrade when no active hold or unreceipted materialization remains. Errors, quarantine, redrive and authority rules are unchanged. Claims lock a durable turn, split the batch between the preferred lane and the other, borrow unused capacity, then interleave the final response starting with the preferred lane when nonempty; the turn advances opposite that first served lane in the same transaction as the tokens. Batch sizes, rearm, lease, backoff and pass timing are unchanged, and no new setting is introduced.

Claim selection uses the lane/due index and materializes candidate IDs before updating leases. Healthy reports use full-key receipt probes for the current intent. Recheck both query plans after PostgreSQL or predicate/index changes, including generic plans and intents with many materializations; indexed selection alone does not guarantee an efficient update or receipt join.

Every jobs-service replica reads the same database totals; aggregate with max, not sum. Failed collection omits samples rather than reporting a healthy zero.

Discovery lane metric definitions and collectioninternal/repository/jobs/container_intent_metrics.go

Logs

Structured application logs include service context and trace correlation where available. Container job stdout and stderr are a separate product data stream and follow the live/retained log pipeline.

Investigation order

Start from the user-visible request or job ID, locate its trace, inspect failed spans and correlated logs, then confirm durable state in PostgreSQL and transport progress in Kafka.