What you need
- Multimeter for macOS 13 or later, $19.99 once.
- A Prometheus server your Mac can reach, like
http://prometheus.local:9090. jqto encode the query (optional; it comes with macOS 15 and later).
Set it up
- Encode your query for a URL. This prints the encoded form:Terminal
jq -rn --arg q '100 - avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100' '$q|@uri' - Build the address and check it in Terminal:Web address
http://prometheus.local:9090/api/v1/query?query=ENCODED_QUERY - Add a Web Address meter with that address and the key path
data.result.0.value.1. - Refresh every 30 or 60 seconds and set the range that fits the metric.
Multimeter settings
In Customize This Meter… (from the meter’s menu):
| Setting | Value |
|---|---|
| Source | Web Address |
| Web address | http://HOST:9090/api/v1/query?query=ENCODED_QUERY |
| Key path | data.result.0.value.1 |
| Refresh every | 30 seconds |
| Range | whatever fits, like 0 to 100 for a percentage |
| Face | Needle Gauge, Sparkline or Arc Gauge |
Tested: Run on October 29, 2026 against Prometheus in Docker and the public demo at prometheus.demo.prometheus.io: sum(up) returned 1 and a request-rate query returned 0.0667.
More on this source, including every format it reads, in the Web Address guide.
Limits
- The query must return one series. Wrap it in
sum(),avg()ormax()so it does. - Prometheus returns the value as a string like
"0.0667"; Multimeter reads the number inside it.
Variations
Prometheus behind a login, or Grafana Cloud
Web Address meters don’t send headers. Use a Script meter with curl, keeping the password in the Keychain:
curl -s -m 8 -u "USER:$(security find-generic-password -s prometheus -w)" --data-urlencode 'query=sum(up)' https://prometheus.example.com/api/v1/queryTargets down
Query count(up == 0). An empty result means none are down; use count(up == 0) or vector(0) so you always get a number.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No number found in the response | The key path doesn’t match the reply. | Run curl -s with the address and read the JSON. Dots walk into objects, numbers pick array items (items.0.count). |
| Couldn’t reach the address | No network, a typo in the host, or the service is down. | Open the address in your browser. Multimeter tries again at the next refresh. |
| No number found, but the query works in Grafana | The query returns several series, or none. | Aggregate it (sum(...)) and add or vector(0) for the empty case. |
| The server answered 400 | The query in the address isn’t encoded. | Encode it with the jq line in step 1. |
Questions
Can I point it at Grafana instead?
Grafana’s API needs a token in a header and returns its own format. Asking Prometheus directly with the panel’s query is simpler and gives the same number.
Is it safe to keep the token in the Keychain?
It is the safest place on a Mac for it: encrypted, unlocked with your login, and never written into the command, a dotfile or your shell history. The meter reads it with the security tool each time it runs.