Observability and diagnostics

Release status: 3.0.0 and develop
This section covers the open edition: one node, one machine. Everything here is read from the node itself. Nothing is sent anywhere unless you configure a collector. Much of this section describes the develop branch of the product repository, which is ahead of the released 3.0.0. The table under What is released says which is which, and each page repeats it. "On develop" means merged in the product repository but not in a release yet.

Relata DB needs no external tool for diagnosis. One binary produces logs, Prometheus metrics, optional OpenTelemetry traces, SQL system views, a slow-query list, CPU and heap profiles, a jobs view, an audit log, a local diagnostic history and an offline support bundle.

What is released

AreaIn released 3.0.0Only on develop
LogsLevel, format, per-crate targets, /admin/logs, X-Request-IdLog channels, message ids, redaction markers, request fields on every log line
Metrics/metrics, health probes, HTTP and error-code series, alert rules, overview and storage dashboardsModule, job, cache, memory-breakdown, freshness, refused-write and sign-in series, further alerts, profiling dashboard, trace exemplars
TracesOTLP span exportOpenTelemetry semantic conventions, one span per module boundary
QueriesSlow-query list for /v1/query, EXPLAIN ANALYZErelata_stat_statements and its reset, relata_stat_activity, query cancel, slow queries from every door
Memory and cachesCPU profile (RELATA_PPROF_ENABLE)One metric set for all caches, relata_stat_caches, cache clear and budget, heap-profiling build
JobsMaintenance operation listrelata_stat_jobs, pause, resume and cancel, relata_stat_cleanup, history compaction and eviction, index check
Audit and errorsAudit log and its query API, relata explain-errorrelata_stat_sessions, sign-in failure series, relata_stat_errors, module and hint in error bodies
OfflineRELATA_DISCONNECTED, diagnostics snapshot, support bundleDiagnostic history

No relata_stat_* view is in 3.0.0.

What you can see, and where

QuestionWhere to lookPage
Is the node up and ready?GET /health, GET /health/readyMetrics, alerts and dashboards
What happened to one request?X-Request-Id, the request_id in an error body, the log stream, the audit logLogging and correlation ids
Is the error rate or latency rising, and where?/metrics: relata_http_*, relata_module_*Metrics, alerts and dashboards
Which statements cost the most? Which is running now?relata_stat_statements, relata_stat_activity, the slow-query list, EXPLAIN ANALYZEDiagnosing a slow query
Where is memory going? Is a cache worth it?relata_memory_*, relata_stat_caches, /admin/debug/pprof/*Memory, caches and profiling
Is a compaction, reindex or backup running, stuck or failing?relata_stat_jobs, /admin/jobs/{id}/*Background jobs and housekeeping
Who did what? Who failed to sign in? Which keys are in use?GET /v1/audit/log, relata_stat_sessions, relata_auth_failures_totalAudit and login activity
What does this error code mean? Which errors are rising?relata explain-error <code>, relata_stat_errorsError codes
What do I send to support from a machine with no internet?relata support-bundle, {data_dir}/diagnostics/Air-gapped sites and support bundles

System views

On develop, eight read-only views answer SQL on POST /v1/query, like PostgreSQL's pg_stat_* views. Each one is also a key of GET /v1/system/stats.

ViewOne row perPage
relata_stat_statementsquery shape and tenantDiagnosing a slow query
relata_stat_activityquery running nowDiagnosing a slow query
relata_stat_cachescacheMemory, caches and profiling
relata_stat_jobsbackground job kindBackground jobs and housekeeping
relata_stat_sessionsregistry token that has made a requestAudit and login activity
relata_stat_errorserror code and moduleError codes
relata_stat_cleanupobject type, plus one node row for retained WALBackground jobs and housekeeping
relata_stat_settingssetting the binary knowsbelow
SELECT name, value, source FROM relata_stat_settings WHERE source = 'env' ORDER BY name

The views take a column list or *, COUNT(*), WHERE, ORDER BY, LIMIT and OFFSET. Joins, grouping, set operations, CTEs, AS OF and WITH PROVENANCE answer 400 unsupported-query-type. Most views describe the whole node, so only an operator, oversight or unscoped key reads them; a tenant-scoped token gets 403 forbidden. relata_stat_statements is the exception: a tenant-scoped token sees its own rows. Every SQL read of a view is audited. Counters in these views start again when the process restarts. Statement statistics can also be reset.

relata_stat_settings comes from the same source as relata config explain. Secrets show as ‹redacted:secret›. Its source column is env, CLI flag, relata.toml or default, and restart_required says whether a change needs a restart.

The two listeners

The data plane (default 127.0.0.1:9090) serves /health, /metrics, /v1/system/stats, /v1/query and /v1/audit/log. The admin listener (default 127.0.0.1:9091, loopback only) serves /admin/*: logs, jobs, maintenance runs, cache clears, query cancels and profiles. Admin routes need RELATA_ADMIN_TOKEN. Data-plane routes need an API key minted with relata token create or POST /admin/tokens. See Auth and security.

# Examples in this section use two variables you set yourself:
#   RELATA_API_KEY      an API key for the data plane (port 9090)
#   RELATA_ADMIN_TOKEN  the admin token for the loopback admin listener (port 9091)
curl -s http://127.0.0.1:9090/health
curl -s -H "Authorization: Bearer $RELATA_API_KEY" http://127.0.0.1:9090/v1/system/stats | jq .

Command-line tools

  • relata doctor checks the environment before start, without starting the server.
  • relata top is a live terminal view of queries, latency and queue depth.
  • relata logs reads the server log; --redact (on develop) replaces user values and secrets with markers.
  • relata check-indexes (on develop) compares the search, vector, graph and identity indexes with their rows.
  • relata explain-error <code> describes an error code offline.
  • relata support-bundle writes a redacted archive for a support request.

What is coming

Wait events, module metrics for the remaining modules, further trend alerts, more in the support bundle and the other open items are tracked in #7849.

See also the shorter Observability guide.