Asset Core Docs

Deterministic world-state engine documentation and API references.

Decision Gate docs

Health and Metrics

Asset Core daemons expose health endpoints for monitoring and Prometheus metrics for observability. These signals are designed to show readiness, freshness, and lag so operators can catch issues before they impact users.

Overview

Both write and read daemons provide:

  • Health endpoint: JSON status for load balancers and monitoring
  • Metrics endpoint: Prometheus-format metrics for dashboards and alerting (disabled by default, served on a dedicated listener)

Structure

Health Endpoints

DaemonEndpointDescription
WriteGET /v1/write/healthStatus, version, and uptime
ReadGET /v1/read/healthReadiness plus freshness for a namespace (uses x-assetcore-namespace when not configured)

Metrics Endpoints

DaemonEndpointFormat
WriteGET /v1/write/metricsPrometheus text (on metrics listener)
ReadGET /v1/read/metricsPrometheus text (on metrics listener)

Metrics are disabled by default. Enable them in daemon-write ([logging] metrics_enabled) and daemon-read ([observability] metrics_enabled), set distinct metrics_address values, and optionally allowlist principals for /v1/write/metrics and /v1/read/metrics. Plan to scrape these endpoints early in production so you can see freshness lag trends.

Fields

Health Response

{
  "status": "ready",
  "freshness": {
    "namespace": 1,
    "world_seq": 128,
    "commit_log_world_seq": 130,
    "lag": 2,
    "lag_ms": 250
  }
}
FieldDescription
statusRead: starting, ready, degraded; Write: healthy
versionWrite-only daemon version string
api_versionWrite-only API version string
build_git_shaWrite-only Git commit SHA when available
uptime_secsWrite-only seconds since process start
freshnessRead-only freshness metadata for the namespace

Key Metrics

Write Daemon

MetricTypeDescription
ingress_requests_totalCounterTotal ingress requests by route/outcome
ingress_request_duration_secondsHistogramIngress request latency
commit_duration_secondsHistogramEnd-to-end commit latency
ingress_queue_depthGaugeItems waiting in queue
ingress_inflightGaugeRequests being processed
commit_log_end_seqGaugeLatest committed sequence
commit_log_driver_lag_eventsGaugeCommit log driver lag in events

Read Daemon

MetricTypeDescription
http_requests_totalCounterTotal HTTP requests by route/outcome
http_request_duration_secondsHistogramHTTP request latency
read_checkpoint_seqGaugeApplied sequence
read_commit_log_end_seqGaugeObserved commit log sequence
freshness_lag_eventsGaugeEvents behind commit log
freshness_lag_msGaugeMilliseconds behind commit log
snapshot_publish_duration_secondsHistogramSnapshot publish time

Examples

Check Write Health

curl -H "Authorization: Bearer $ASSETCORE_ADMIN_TOKEN" \
  http://localhost:8080/v1/write/health | jq .

Check Read Freshness

curl -H "Authorization: Bearer $ASSETCORE_READ_TOKEN" \
  http://localhost:8081/v1/read/namespaces/5001/freshness | jq .

Scrape Metrics

Add to your Prometheus configuration:

scrape_configs:
  - job_name: 'assetcore-write'
    static_configs:
      - targets: ['localhost:9100']
    metrics_path: '/v1/write/metrics'

  - job_name: 'assetcore-read'
    static_configs:
      - targets: ['localhost:9101']
    metrics_path: '/v1/read/metrics'

Example Prometheus Queries

Request rate:

rate(ingress_requests_total[5m])

P99 latency:

histogram_quantile(0.99, rate(ingress_request_duration_seconds_bucket[5m]))

Read daemon lag:

freshness_lag_events

Error rate:

rate(http_requests_total{outcome!="success"}[5m])

Example Alerts

groups:
  - name: assetcore
    rules:
      - alert: HighReadLag
        expr: freshness_lag_events > 100
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: "Read daemon is behind commit log"

      - alert: WriteQueueFull
        expr: ingress_queue_depth > 900
        for: 1m
        labels:
          severity: critical
        annotations:
          summary: "Write queue approaching capacity"