Azure: Metrics and logs

Three panels on every database: Metrics, for how it is behaving, Logs, for what the engine has said about it, and Slowlog, for the commands that took…

Three panels on every database: Metrics, for how it is behaving, Logs, for what the engine has said about it, and Slowlog, for the commands that took longest to run.

Metrics

The Metrics panel. Memory, throughput, connections and hit rate, over a range you choose.

Scraped every fifteen seconds and kept for the retention window of the environment your database is in. The range selector changes both how far back you are looking and the resolution — a one-hour view is finer-grained than a seven-day one, because the seven-day view is aggregating.

What to look at first

Memory used against the limit. The number that matters most. A database at its limit keeps every key it has and refuses new writes with an out-of-memory error (its policy is noeviction); reads keep working. If the line is flattening near the top, that is the moment to resize.

Hit rate. A cache with a low hit rate is doing work for nothing. A sudden drop usually means a key pattern changed or a deploy started asking for something that was never written.

Connections. Compare against your tier's limit. Applications that open a connection per request rather than pooling hit that ceiling long before they hit any throughput limit.

Operations per second. Useful as a shape rather than a number — the level tells you less than a step change does.

A database with no metrics

An empty chart is not always an idle database. If everything reads zero and the database is plainly serving traffic, the scrape is not reaching it, and that is a fault to report rather than a quiet period. Metrics for a database created in the last minute or two are genuinely empty, because nothing has been collected yet.

Logs

The Logs panel, with level filtering and a volume graph over time.

What the engine itself writes: startup and configuration, replication events, persistence, evictions, warnings and errors. It is not a record of the commands your application ran — that is what the Explorer and your own instrumentation are for.

Filter by level to separate the ordinary from the notable. The volume graph above the lines is often the faster read: a spike in warnings at a particular minute tells you where to look before any individual line does.

What you will see, and what it means

Background saving started / Background saving terminated with success — a snapshot being taken. Normal, and expected on whatever schedule you have set.

Evicted keys — the memory limit was reached and keys were removed to make room. The database is working as configured, but it is now smaller than your data, which is worth knowing.

Replication lines — a replica connecting, syncing, or being promoted. On a Pro database these appear during failover and are the clearest record of what happened and when.

MISCONF — the engine refused a write because it could not persist. Rare, and always worth reporting.

Slowlog

The Slowlog tab lists, for each node, the most recent commands that took longer than 10 ms to run, newest first. Each entry shows when the command started, how long it ran, the command with its arguments, and the address and name (CLIENT SETNAME) of the client that sent it.

  • Timed inside the engine. The duration is the time the engine spent executing the command; it does not include the network or time waiting in a client's queue. A request your application saw as slow but that is not here was slow somewhere else.
  • Per node. Every node keeps its own log, so the tab shows one list per node, labelled as in the Nodes panel: the primary and each replica, and on a sharded database each shard's primary and replicas. A replica's list has the reads sent to the read-only endpoint.
  • In memory, and short. Each node keeps up to its last 128 slow commands (shown beside each list) and forgets them when it restarts, so a failover, a resize or an engine upgrade starts the list again.
  • Arguments as the engine kept them. At most 32 arguments, each cut at 128 bytes; the engine summarises the rest in the last one.
  • The threshold is 10 ms on every database and is not configurable yet. A database created before the slow log was turned on everywhere has it turned on the first time its slow log is read: the tab says so, and the list fills from then. On KiviDB versions before 1.0.5, connections that were already open at that moment are recorded only after they reconnect.

The arguments are your keys and values, so the slow log is data, not metadata: the viewer role cannot read it, through the console or the API.

From the API, GET /instances/{id}/slowlog returns the same lists (?count= 1-128, default 50; ?node_id= for one node). It takes an API key whose role may read data.

Exporting

Export on the logs panel downloads the current view, filters included. Use it when you want to attach something to a support conversation rather than describe it.

Through an assistant

get_metrics, get_logs and get_slowlog return the same data as these panels, so an assistant can answer "is this database healthy?" without you opening the console. See the tool reference.