Skip to content
Menu

DocsFeatures

View as Markdown

Observability

Metrics, PostgreSQL logs, query insights from pg_stat_statements, live sessions, the SQL editor, the activity log and the status page.

Metrics

The database's Overview page charts these metrics over the last hour, 24 hours, 3 days, 7 days, 14 days or 30 days, with one point every minute, 5 minutes, 15 minutes, 30 minutes or hour (14 and 30 days). Table lists the same numbers. Every metric is the primary's: read replicas are not included. Every plan shows all six ranges; PostgreSQL logs are kept for a shorter window per plan.

MetricWhat it measures
CPUvCPU the primary uses, averaged over each point while the database runs, against the vCPU allocated to it (0.05 vCPU while a Free or Launch database idles at its warm size). 1 vCPU is one CPU thread busy the whole time. Free and Launch can use idle cores above their allocation
MemoryThe primary's working set (memory in use, including file cache it used recently), averaged over each point while the database runs, against the memory allocated to it: on Free and Launch its memory limit, on Dedicated the size's RAM (the primary has its server to itself)
Cache missesShare of the primary's block reads PostgreSQL did not find in shared buffers and read from the operating system, which serves them from its file cache or the disk. The tooltip and the latest reading give the cache hit ratio
ConnectionsSessions on the primary when each minute is read; a longer point shows the highest. A client of the connection pooler is not a session there: the pooler's server connections are. Its clients share them, and an idle one stays open for 60 seconds after its last use (10 minutes on a database that never sleeps): the count is the pool's connections, not its clients, and it falls only that long after they leave. KeelDB's own monitoring sessions are left out
Transactions per secondCommitted transactions per second on the primary, averaged over each point while the database runs. Read-only transactions count, rollbacks do not
Storage usedSize of your database as pg_database_size reports it: tables, indexes and their free space. The write-ahead log and backups are not in it. Storage limits and Launch storage billing use this size

How they are measured:

  • CPU and memory come from the Kubernetes metrics API, which measures each instance over 15-second windows. KeelDB reads it every 10 seconds, so each minute is the average of that minute's windows. On a point longer than a minute, the tooltip also shows its highest minute.
  • Cache, connections and transactions come from PostgreSQL's statistics views (pg_stat_database, pg_stat_activity), read a few seconds after each minute ends from the postgres maintenance database, so the readings never count as your transactions or sessions. A minute's commits and block reads are the increase since the read of the minute before. These counters belong to one server: after a restart, a failover to a standby or a statistics reset, the first minute has no increase and is left out of the averages instead of counting as zero. A database that slept keeps its counters, so the first minute after it wakes up has its commits.
  • Sampling never wakes a database: a sleeping or suspended database has gaps, and a point that holds both running and sleeping minutes averages the minutes it ran.
  • Sizes are binary, as in PostgreSQL's pg_size_pretty: 1 MB is 1,048,576 bytes and 1 GB is 1,073,741,824 bytes. Plans, limits and prices count GB the same way.

CPU, memory, cache, connections and transactions come from GET /databases/{id}/metrics/compute. Storage, connections and transactions are also sampled every 5 minutes. Get the samples from the API:

curl "https://keeldb.com/api/v1/databases/k7m2x9qa4pz1/metrics?range=24h" \
  -H "Authorization: Bearer $KEELDB_API_KEY"
{
  "data": [
    { "t": "2026-10-07T09:00:04.000Z", "storageBytes": 52428800, "connections": 4, "tps": null },
    { "t": "2026-10-07T09:05:04.000Z", "storageBytes": 52445184, "connections": 6, "tps": 12.47 }
  ]
}

range is 1h, 24h (default), 3d, 7d, 14d or 30d on every plan; another value is refused with 422 invalid_input. Samples are taken every 5 minutes while the database runs. tps is the commits per second on the primary over the 5 minutes since the previous sample. It is null for the first sample of a range, and when no rate over 5 running minutes exists: the samples are more than 5.5 minutes apart (the database slept in between), or PostgreSQL restarted, woke up or failed over in between.

PostgreSQL logs

The Logs tab shows what PostgreSQL itself logged for your database, newest first:

KindWhat it is
ErrorsStatements and sessions that failed, and warnings: the severity (WARNING, ERROR, FATAL or PANIC), the SQLSTATE code, the message, its detail and hint, and the statement that failed. A wrong password shows as FATAL with 28P01
Slow queriesStatements that ran at least the database's slow query threshold, with how long they ran in milliseconds
ConnectionsSessions being authorized and ending, with how long a session lasted

Each record names the role, the database and the application_name of the session, and the instance that wrote it. Records appear within about a minute. You can filter by kind, search the messages and statements, and for slow queries set a minimum duration. Statements carry their values, so the Logs tab needs the owner, admin or developer role, like the SQL editor.

  • Slow query threshold. 1,000 ms by default. Set it from 100 to 60,000 ms on the Logs tab, with slow_query_ms in PATCH /databases/{id} or the update_database MCP tool. It applies within a minute or two, without a restart.
  • Kept for the plan's window: 1 day on Free, 3 days on Launch, 14 days on Dedicated. Older records are deleted; copies in the encrypted backups of KeelDB's own database go with those backups, within 40 days.
  • What is in it. Your applications' sessions, the statements you run from the SQL editor, POST /databases/{id}/query, the run_sql MCP tool and keeldb query (application keeldb-sql), and clients that set no application_name (the proxy names them keeldb-proxy).
  • What is left out. KeelDB's own sessions (monitoring, the console's schema and insights reads, backups, replication), PostgreSQL's background processes (checkpoints, autovacuum) and connection attempts that never reached authentication. Connection records do not show the client's address: connections reach your database through KeelDB's proxy and pooler, so the address PostgreSQL sees is theirs, not your client's.
  • Passwords are hidden. The password of CREATE ROLE and ALTER ROLE (quoted or not, with or without a space after PASSWORD, also inside a DO block), password= in connection strings and the password of a postgresql:// URI are replaced by [redacted] before the record is stored. A password typed without quotes is also hidden from the syntax error that names it.
  • Limits. Statements and messages are cut at 4,000 characters, details and hints at 1,000. Each minute of a database's log keeps at most 100 records on Free, 1,000 on Launch and 5,000 on Dedicated; above that, errors are kept first, then slow queries, then connections, and one warning record says how many of that minute's records were not kept. A database keeps at most 10,000 records on Free, 100,000 on Launch and 500,000 on Dedicated, and the oldest go first. A busy database that logs every connection reaches these sooner: use the pooler, whose server connections stay open.

Get the same records from GET /databases/{id}/logs, the get_logs MCP tool or the CLI (keeldb logs <id>).

Export to OpenTelemetry

On Scale, a database pushes its metrics and its PostgreSQL logs to your own OpenTelemetry collector, so they sit next to your application's in Grafana, Datadog, Honeycomb or any tool that takes OTLP. It is included in Scale.

  • What is sent. Every minute: the metrics of the Metrics charts (CPU and memory used and allocated, sessions, instances, commits, cache hits and reads), as OTLP gauges and sums, and the log records of the Logs tab, as OTLP log records with PostgreSQL's severity, SQLSTATE, statement, role and database. Each carries the database's id, name, plan, region and PostgreSQL version.
  • Where. The collector's OTLP over HTTPS base URL, for example https://otlp.example.com:4318; KeelDB posts JSON to its /v1/metrics and /v1/logs. The endpoint must be https on a public host name or address. Headers such as an API key are kept encrypted and never shown back; put credentials there, never in the URL.
  • When it fails. A refused or unanswered push waits a minute, then longer each time, up to an hour, and the console and the API show the last error. Nothing is lost while the collector is down for less than a day: the next push sends what was not sent yet, at most a day back.
  • Set it in the database's Settings, with PUT /databases/{id}/telemetry-export or the set_telemetry_export MCP tool.

Query insights

The Insights tab reads PostgreSQL's own statistics views:

SectionContents
Top queriesThe 25 statements with the highest total execution time, from pg_stat_statements: calls, total and mean time, rows
TablesThe 25 largest tables: total size, live rows, sequential and index scans, dead rows
Unused indexesUp to 15 indexes, largest first, that have never been scanned (primary key and unique indexes excluded)
Cache hit ratioShare of your database's block reads found in shared buffers since its statistics were last reset
Live sessionsUp to 50 client sessions: state, duration, query (first 500 characters), wait event and application name
ConnectionsActive and idle client sessions on the server, against max_connections. KeelDB's own sessions are left out

From live sessions you can Cancel a running query (pg_cancel_backend) or Terminate the session (pg_terminate_backend). Both need the owner, admin or developer role and are written to the audit log.

pg_stat_statements is installed in every database and tracks nested statements too (pg_stat_statements.track = all). Your role can read all statistics views, so you can query them directly:

SELECT calls, round(mean_exec_time::numeric, 2) AS mean_ms, left(query, 80) AS query
FROM pg_stat_statements
WHERE dbid = (SELECT oid FROM pg_database WHERE datname = current_database())
ORDER BY total_exec_time DESC
LIMIT 10;

Set application_name in your connection settings so your services are easy to tell apart in live sessions. Insights are also available to AI assistants through the get_insights MCP tool.

SQL editor

The SQL tab runs queries in the browser, with a schema browser and a history of your last 30 queries (kept in your browser). Press Cmd+Enter or Ctrl+Enter to run.

LimitValue
Statement timeout30 seconds
Rows returned per resultFirst 500 (the result says when it was truncated)
Characters per cell2,000
Query text200 KB
  • Queries run as your database's owner role, not as a superuser.
  • You can send several statements at once. Unless you use explicit BEGIN/COMMIT, they run in one implicit transaction: if one fails, the earlier ones are rolled back too.
  • Every run is written to the audit log with the first 160 characters of the statement.
  • If a Free database is asleep, the editor starts waking it and asks you to run the query again in a minute.
  • Running SQL needs the owner, admin or developer role.

The same engine, with the same limits, backs the REST query endpoint and the run_sql MCP tool.

Activity and audit log

The Activity tab of each database has two parts:

  • Operations: restarts, backups, failovers and password rotations with their result, who requested them and any error.
  • Audit log: every change to the database, who made it and when, kept for 400 days. This includes settings and plan changes, credential reveals, SQL runs, storage growth, sleep and wake-ups, and availability incidents. See Audit log.

Status page

keeldb.com/status shows the health of the API and console, database connectivity through the proxy, and each region. KeelDB probes these every 30 seconds and opens an incident after three consecutive failures. Public incidents appear on the status page.

Each running database is also probed every 30 seconds. If yours stops responding, its activity log records when it went down and when it recovered.