Metrics, alerts and dashboards

Release status: 3.0.0 and develop
The full list of series is the metrics reference in the product repository (develop branch). Released 3.0.0 has the health probes, /metrics with the HTTP, error-code (code label only), lock-wait and durability series, 17 alert rules, the overview and storage dashboards and OTLP span export. The module, job, cache, memory-breakdown, freshness, refused-write and sign-in series, six further alerts, the profiling dashboard, exemplars, module spans and the OpenTelemetry naming below are on develop. "On develop" means merged in the product repository but not in a release yet.

Health probes

RouteMeaning
GET /healthLiveness. 200 while the process runs.
GET /health/readyReadiness. 503 application/problem+json when a check fails; the type names the check.

Probes never take a data-plane permit, so they answer even when the node is shedding load. On develop they also have their own per-address rate limit, RELATA_HEALTH_RATE_LIMIT_RPS (default 100), so data requests from the same address cannot get a probe refused. An unauthenticated caller gets a bare status; a caller with a registry token also gets the detail behind it.

Scraping /metrics

GET /metrics serves Prometheus text. It fails closed: no credential, an unknown key or the admin token gets 401. Scrape with an ordinary data key from relata token create:

scrape_configs:
  - job_name: relata
    metrics_path: /metrics
    authorization:
      type: Bearer
      credentials_file: /etc/prometheus/relata-api-key
    static_configs:
      - targets: ["relata.internal:9090"]

Set RELATA_METRICS_PUBLIC=true only when authentication is done at the network layer. A scrape never makes a writer wait. If a writer holds the store at that instant, the store-derived series are left out of that scrape rather than reported as zero, and relata_memory_breakdown_complete reads 0. Scrape every 15 seconds or slower.

Series to start with

QuestionSeries
Error rate and latencyrelata_http_responses_total{status_class}, relata_http_request_duration_seconds
Which routerelata_http_requests_total{endpoint,method,status_class}, relata_http_route_duration_seconds (the endpoint label is the route template, capped at 512 series)
Which modulerelata_module_ops_total{module,op}, relata_module_errors_total{module,op,code}, relata_module_duration_seconds{module,op}
Which errorrelata_problem_responses_total{code,module}
Which operatorrelata_query_operator_seconds_total{operator}, relata_query_door_operator_seconds_total{door,operator}
Waiting on a lockrelata_lock_contended_total{lock}, relata_lock_wait_seconds_total{lock}, relata_lock_wait_duration_seconds{lock}
Memoryrelata_memory_subsystem_bytes{subsystem}, relata_memory_unattributed_bytes, relata_process_resident_bytes
Cachesrelata_cache_hits_total{cache}, relata_cache_misses_total{cache}, relata_cache_bytes{cache}
Background jobsrelata_job_runs_total{kind,result}, relata_job_last_success_timestamp_seconds{kind}
Index freshnessrelata_freshness_lag_seconds{index}
Refused writesrelata_write_refused_total{door,reason}
Sign-in failuresrelata_auth_failures_total{reason}
Durabilityrelata_wal_write_failures_total, relata_audit_drops_total

Metric names follow ADR-0137. Per-operator series are sampled (RELATA_PROFILE_SAMPLE_RATE, default 0.01); module, job and cache series count every call.

Standard module metrics

Modules report the same three families, labelled by module (a fixed list of 17 names, such as query, planner, acl, wal) and op (a fixed verb). Today query (parse, execute, execute_acl), planner (plan) and acl (evaluate, row_filter, cell_mask) report them.

# error rate of query execution by code
sum by (code) (rate(relata_module_errors_total{module="query",op="execute"}[5m]))
# p99 planning time
histogram_quantile(0.99, sum by (le) (rate(relata_module_duration_seconds_bucket{module="planner",op="plan"}[5m])))

Use the module series to see which module is slow or failing. Then use the per-operator series or EXPLAIN ANALYZE to find the operator inside it.

Refused writes

On develop, relata_write_refused_total{door,reason} counts every row a write path refused, including commit bundles, the agent-memory routes, MCP write tools and refusals an ingest door makes before writing. That includes refusals answered with a short count such as {"inserted": 0}, which a client may not notice. reason names the cause, for example acl_denied, schema_violation, wal_latched or disk_pressure. The runbook lists every reason and what to do.

Alerts

The Helm chart ships a PrometheusRule (prometheusRule in the chart values), and the same rules are in infra/monitoring/alerts.yaml of the product repository. On develop there are 23 rules (3.0.0 ships 17):

AreaAlerts
DurabilityRelataWalWriteFailures, RelataWalMirrorBehind, RelataWalRecordsDropped, RelataIngestRowsDropped, RelataWritesRefused
AuditRelataAuditChainInvalid, RelataAuditDrops, RelataAuditArchiveFailing, RelataAuditArchiveLag, RelataAuditDirLowSpace, RelataAuditForwardDrops
TrafficRelataHttp5xxErrorRate, RelataHttpLatencyP99High, RelataIngestQueueBackpressure
Sign-inRelataAuthFailureSpike
BackupRelataBackupStale, RelataBackupFailed
Jobs and workersRelataJobNotSucceeding, RelataJobLooping, RelataBackgroundWorkerDead
Search and indexesRelataFtsPendingDrops, RelataFreshnessLag
CachesRelataCacheNetCost

Every alert has a section in the runbooks. In the open build RelataAuditChainInvalid fires when audit records were dropped under backpressure; it is not a tamper check (see Audit and login activity).

Four service-level objectives (availability 99.9%, latency p99 under 1 s, audit integrity, WAL durability) are defined in docs/operations/slos.md with their queries.

Dashboards

Three Grafana dashboards are in infra/monitoring/dashboards/ of the product repository: relata-overview.json, relata-storage.json and relata-profiling.json. The node also serves a small HTML view at /admin/dashboard on the admin listener; the page loads without a token, but every call it makes needs one.

Trace exemplars

On develop, a scraper that asks for application/openmetrics-text gets OpenMetrics 1.0, and each relata_module_duration_seconds bucket carries the trace id of the latest sampled observation in it, so a slow bucket links to a trace. Exemplars exist only when RELATA_OTLP_ENDPOINT is set. Other scrapers get the Prometheus text format unchanged. In Prometheus, enable exemplar storage with --enable-feature=exemplar-storage.

Traces

Tracing is off unless RELATA_OTLP_ENDPOINT is set. RELATA_OTLP_SAMPLE_RATIO defaults to 0.01. Use an endpoint inside your network boundary. A slow-query entry carries the W3C traceparent of its request, so a trace and a slow query can be matched.

On develop:

  • RELATA_OTLP_ENDPOINT is the collector base URL and /v1/traces is appended; a value that already ends in /v1/traces is used as given. A failed export is counted in relata_otlp_export_failures_total{signal="traces"} and logged.
  • Exported spans follow the OpenTelemetry semantic conventions. The resource carries service.name=relatadb, the version, an instance id and the host name. The HTTP span carries http.request.method, http.route, http.response.status_code and relata.request_id. The query.execute span carries db.system.name=relatadb, db.operation.name, db.collection.name, db.query.summary and, on /v1/query, the literal-free db.query.text.
  • INFO spans and WARN and ERROR log lines are exported whatever RELATA_LOG_LEVEL says. Log lines travel as span events.
  • Each module boundary opens one span named <module>.<op>, such as query.parse, planner.plan, acl.row_filter, query.join, storage.scan, fts.search, vector.search, cache.lookup and wal.commit. A traced slow query therefore reads as a tree that shows where the time went. The operator guide lists them all.

RELATA_OTLP_ENABLED=true is different: it turns on the node's own OTLP ingest routes (POST /v1/traces, /v1/metrics, /v1/logs) for receiving data, not for exporting it.

What is coming

Module metrics for the remaining modules and trend alerts for memory slope, unattributed memory, file descriptors and threads are tracked in #7849.