This page describes Calíope 1.8, the version I am building right now. 1.7 is on the App Store for the Mac, iPad, iPhone, Apple Watch, Apple TV and Apple Vision Pro. The changelog says which version each feature landed in.

Adds an “Open in Calíope” button to every topic. It only works with the app installed.

SQL Alerts

SQL alerts

Watches the value returned by a query of yours and flags ALERT when it crosses the threshold you define.

Where it is: Workspace › Tools › SQL Alerts

Open SQL Alerts from the workspace navigation bar. The table lists every configured rule with its current value and an ALERT / OK indicator. A rule whose query fails says Error —open it in Configure to read what the server answered—, one whose query returns no rows, or returns NULL, says No value, and one not measured yet shows a dash: none of them counts as OK. On a connection whose environment tag protects it —confirm writes or read only—, a rule whose query writes is not run and says Refused: writes with the tag’s name: an alert runs on its own and cannot ask for confirmation.

Each rule is a query of yours: Calíope runs it at the defined interval, takes the value of the column you named and compares it against the threshold with the chosen operator (>, <, =, <>). There are no predefined metrics — you decide what to watch with SQL.

Refresh evaluates every rule once.

Auto-refresh: press the play button and enter the interval in seconds so rules re-evaluate on their own. When a rule meets its condition its row is flagged ALERT and the view footer counts how many are active. The shortest interval is one second. Re-evaluation stops when you press pause or leave the tool.

Load example adds a ready-made rule so you start from something that works.

MySQLMariaDBAuroraPostgreSQL

There is one: active connections above 100.

SQL Server

There are five, and each press adds the next one you don't have yet: blocked sessions, user sessions above 80 % of the maximum, transactions open over a minute, the database's transaction log above 80 %, and seconds spent waiting on locks since the server started. When you have all five, the button turns off.

ClickHouse

There are five, and each press adds the next one you don't have yet: memory in use as a percentage of the server limit, queries running now, replicas more than a minute behind, unfinished mutations that have already failed, and the partition with the most parts as a percentage of the limit at which the server rejects INSERTs. When you have all five, the button turns off.

Oracle

There are five, and each press adds the next one you do not have yet: more than 20 user sessions running something now, blocked sessions, the fullest tablespace above 85 % of its maximum, invalid objects and sessions with the same call for more than a minute. Those that read V$SESSION or tablespace usage need the same privileges as Server Information: without them, the rule says Error. With all five in the list, the button turns off.

TiDB

There are three, and each press adds the next one you do not have yet: sessions in the cluster above 100, slow statements in the last hour above 100 and schema changes running for over ten minutes. With all three in the list, the button turns off.

Export saves the table —rules, values and status— as a tab-separated (TSV) file.

When a rule fires, Calíope tells you: it leaves a system message and, if you are not in front of it, a notification. When, where it arrives and how to turn it off is in the topic “When an alert fires: the message and the notification”.

Keywords: SQL alerts, alert, threshold, rule, metric, watch, auto-refresh, interval, polling, monitor

Configure alert rules

Define which query is watched and the condition that raises the alert.

Where it is: SQL Alerts › Configure

Press Configure in the tool bar. In the sheet, press Add to add a rule and fill in:

- Name — how you will recognise it in the table.
- SQL — the query returning the value to watch. It should return a single row: the first one is read.
- Column — the result column holding the value. If the name matches none, the first column is used.
- Operator and Threshold — the condition that triggers the alert.

MySQLMariaDBAurora

For example: SQL = SHOW STATUS WHERE Variable_name = 'Threads_connected', column = Value, operator = >, threshold = 100.

TiDB

In TiDB SHOW STATUS has no Threads_connected. For the same alert: SQL = SELECT COUNT(*) AS n FROM information_schema.CLUSTER_PROCESSLIST, column = n, operator = >, threshold = 100.

PostgreSQL

For example: SQL = SELECT COUNT(*) AS "Value" FROM pg_stat_activity WHERE pid <> pg_backend_pid(), column = Value, operator = >, threshold = 100.

SQL Server

For example: SQL = SELECT COUNT(*) AS Value FROM sys.dm_exec_requests WHERE blocking_session_id <> 0, column = Value, operator = >, threshold = 0.

ClickHouse

For example: SQL = SELECT count() AS Value FROM system.processes WHERE query_id != queryID(), column = Value, operator = >, threshold = 0: it counts the running queries without counting the rule's own. 64-bit integers arrive as text and are compared as exact numbers, without losing digits.

Oracle

For example: SQL = SELECT COUNT(*) AS "Value" FROM v$session WHERE blocking_session IS NOT NULL, column = Value, operator = >, threshold = 0: it counts the sessions waiting for another one. A NUMBER arrives with all its digits and is compared as an exact number.

If the value is not numeric, it is compared as text, character by character: > and < follow alphabetical order, which works for dates written as YYYY-MM-DD.

To change a rule, select it in the list, edit it and press Save; Delete, or the bin next to it, removes it. Done stores the rules and evaluates them again.

Rules are stored on this device, apply to every open session and sync to your other devices if you have iCloud sync enabled.

Keywords: configure alert, rule, SQL, column, operator, threshold, threads_connected

When an alert fires: the message and the notification

When a rule turns ALERT, Calíope leaves a system message and, if you are not in front of it, a notification.

Where it is: Workspace › Tools › SQL Alerts

When it tells you. When a rule turns ALERT, not on every cycle it stays in alert. A rule that fires, goes back to OK and fires again tells you each time. One that alternates between the alert and an error, or a query with no rows, tells you at most once every five minutes. That cool-down belongs to each rule: two rules that fire at once both tell you.

What it leaves

• A system message, with the rule's name, its value, the threshold and the profile alias. It is recorded with Calíope in front too, and, if system messages travel through iCloud, your other devices and Calíope on the watch read it; there it belongs to the servers group.
• A local notification, with the rule's name and, below it, the value and the threshold. Only if Calíope is not in front and SQL alert triggered is on in Settings › Notifications: with Calíope in front you already see the row in red.

The value and the threshold come out with the decimals they were written with: 0.15 does not arrive as 0.2.

Rules are only evaluated while the tab is open. On the Mac they keep being evaluated even with another app in front, and then the notification arrives. On iPhone and iPad the system stops Calíope a few seconds after you leave it: a rule that fires in the meantime is evaluated when you come back, and its notice waits in the messages, without a notification.

How to turn it off. The notification, with SQL alert triggered. The message, with Record system messages in Settings › General › System messages, which turns off every kind. On the watch, the switch for the servers group decides whether it sounds.

Keywords: alert, notify, notification, system message, cool-down, five minutes, watch, threshold, rule