Show any Prometheus metric in your Mac menu bar

If a Grafana panel shows it, Prometheus can answer it as one number. Ask the query API with the same PromQL the panel uses and a Web Address meter shows the result, refreshing as often as every 30 seconds.

Recipe tested October 29, 2026 with Multimeter 1.1. Source: Web Address.

Preview: the Needle Gauge face and two alternatives, with sample values like the ones this recipe returns.

What you need

  • Multimeter for macOS 13 or later, $19.99 once.
  • A Prometheus server your Mac can reach, like http://prometheus.local:9090.
  • jq to encode the query (optional; it comes with macOS 15 and later).

Set it up

  1. 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'
  2. Build the address and check it in Terminal:
    Web address
    http://prometheus.local:9090/api/v1/query?query=ENCODED_QUERY
  3. Add a Web Address meter with that address and the key path data.result.0.value.1.
  4. 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):

Settings for this meter
SettingValue
SourceWeb Address
Web addresshttp://HOST:9090/api/v1/query?query=ENCODED_QUERY
Key pathdata.result.0.value.1
Refresh every30 seconds
Rangewhatever fits, like 0 to 100 for a percentage
FaceNeedle 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() or max() 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:

Command
curl -s -m 8 -u "USER:$(security find-generic-password -s prometheus -w)" --data-urlencode 'query=sum(up)' https://prometheus.example.com/api/v1/query

Targets 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

What the meter says, why, and what to do
SymptomCauseFix
No number found in the responseThe 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 addressNo 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 GrafanaThe query returns several series, or none.Aggregate it (sum(...)) and add or vector(0) for the empty case.
The server answered 400The 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.

Related

Put it in your menu bar

$19.99 one-time. No subscription. Needs macOS 13 Ventura or later.