Observability and diagnostics
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
| Area | In released 3.0.0 | Only on develop |
|---|---|---|
| Logs | Level, format, per-crate targets, /admin/logs, X-Request-Id | Log 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 dashboards | Module, job, cache, memory-breakdown, freshness, refused-write and sign-in series, further alerts, profiling dashboard, trace exemplars |
| Traces | OTLP span export | OpenTelemetry semantic conventions, one span per module boundary |
| Queries | Slow-query list for /v1/query, EXPLAIN ANALYZE | relata_stat_statements and its reset, relata_stat_activity, query cancel, slow queries from every door |
| Memory and caches | CPU profile (RELATA_PPROF_ENABLE) | One metric set for all caches, relata_stat_caches, cache clear and budget, heap-profiling build |
| Jobs | Maintenance operation list | relata_stat_jobs, pause, resume and cancel, relata_stat_cleanup, history compaction and eviction, index check |
| Audit and errors | Audit log and its query API, relata explain-error | relata_stat_sessions, sign-in failure series, relata_stat_errors, module and hint in error bodies |
| Offline | RELATA_DISCONNECTED, diagnostics snapshot, support bundle | Diagnostic history |
No relata_stat_* view is in 3.0.0.
What you can see, and where
| Question | Where to look | Page |
|---|---|---|
| Is the node up and ready? | GET /health, GET /health/ready | Metrics, alerts and dashboards |
| What happened to one request? | X-Request-Id, the request_id in an error body, the log stream, the audit log | Logging 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 ANALYZE | Diagnosing 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_total | Audit and login activity |
| What does this error code mean? Which errors are rising? | relata explain-error <code>, relata_stat_errors | Error 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.
| View | One row per | Page |
|---|---|---|
relata_stat_statements | query shape and tenant | Diagnosing a slow query |
relata_stat_activity | query running now | Diagnosing a slow query |
relata_stat_caches | cache | Memory, caches and profiling |
relata_stat_jobs | background job kind | Background jobs and housekeeping |
relata_stat_sessions | registry token that has made a request | Audit and login activity |
relata_stat_errors | error code and module | Error codes |
relata_stat_cleanup | object type, plus one node row for retained WAL | Background jobs and housekeeping |
relata_stat_settings | setting the binary knows | below |
SELECT name, value, source FROM relata_stat_settings WHERE source = 'env' ORDER BY nameThe 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 doctorchecks the environment before start, without starting the server.relata topis a live terminal view of queries, latency and queue depth.relata logsreads the server log;--redact(ondevelop) replaces user values and secrets with markers.relata check-indexes(ondevelop) compares the search, vector, graph and identity indexes with their rows.relata explain-error <code>describes an error code offline.relata support-bundlewrites 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.