PromQL in icLens
Your Agent answers PromQL itself: no Prometheus server needed. Switch a query in Telemetry › Metrics from Builder to PromQL and type.
Try these
Section titled “Try these”Replace the canister ID with one of yours.
Cycle balance of one canister:
iclens_canister_balance_cycles{canister_id="rrkah-fqaaa-aaaaa-aaaaq-cai"}Memory in MiB:
iclens_canister_memory_bytes{canister_id="rrkah-fqaaa-aaaaa-aaaaq-cai"} / 1048576Query calls per second across the fleet:
sum(rate(iclens_canister_query_calls_total[30m]))The five canisters using the most memory:
topk(5, iclens_canister_memory_bytes)Canisters below 1 trillion cycles:
iclens_canister_balance_cycles < 1000000000000Pick a window
Section titled “Pick a window”Monitor reads every 5 minutes by default, so a rate needs a window that holds
several readings: [30m] or longer. A window shorter than the reading
interval comes back empty. Ranges, resolution and rates.
What’s supported
Section titled “What’s supported”| Kind | Supported |
|---|---|
| Selectors | =, !=, =~, !~ |
| Operators | + - * / % ^, comparisons, bool |
| Aggregations | sum, min, max, avg, count, group, topk, bottomk, with by and without |
| Counters | rate, increase, resets |
| Gauges | delta, changes |
| Over time | sum_over_time, avg_over_time, min_over_time, max_over_time, count_over_time, last_over_time, present_over_time |
| Missing series | absent, absent_over_time |
| Histograms | histogram_quantile |
Not supported: subqueries, offset, @, and helpers such as abs or
clamp_min. Durations take one unit, so write 90m, not 1h30m.
Good to know
Section titled “Good to know”- To measure what a canister spent, use
increase()on a consumption counter such asiclens_canister_consumed_instructions_cycles_total. The balance also changes when it’s topped up. - An empty result means nothing was recorded, not zero.
- Very large numbers lose precision in PromQL. A dashboard panel’s Evidence keeps the exact values.