Prometheus
--prom :9124 makes the collector serve Prometheus text on GET /metrics at that
address. This page answers what that exposition carries, what it cannot carry and
has to come from the agent instead, and how to scrape both without counting anything
twice.
Recomputed from the samples
Section titled “Recomputed from the samples”The kernel-tier families on the collector are rendered by the same code the agent runs — its cumulative counters, its busy-tick histogram and its trailing windows — fed by the samples the collector received. A deployment whose collector reaches the agent only through the relay still gets metrics that do not depend on who scrapes or when.
On top of them the collector adds what only it has: the RouterOS API tier’s gauges,
the derive stage’s values, its detection and gap counters, and the device-info
families from the agent’s /capabilities.
Two scrape jobs
Section titled “Two scrape jobs”The Prometheus dashboard expects two jobs: the collector, which has every family the agent has plus its own, and the agent itself, keep-relabelled to the families only the sampler can produce — its tick timing histograms, the trigger and capture counters, slipped ticks:
- job_name: "mikroscope" scrape_interval: 5s static_configs: [{ targets: ["<collector host>:9124"] }]- job_name: "mikroscope-agent" scrape_interval: 5s static_configs: [{ targets: ["172.30.10.2:9123"] }] metric_relabel_configs: - source_labels: [__name__] regex: "mikroscope_(tick_.*|trigger_.*|capture.*|captures_held|slipped_total)" action: keepScraping the agent without the keep list would double every counter the collector also exposes. Point Prometheus at the collector host, or at the agent directly if it can reach the veth.
What only the agent can say
Section titled “What only the agent can say”The collector renders no mikroscope_slipped_total and no
mikroscope_, mikroscope_ or
mikroscope_: it never ran the sampler, and a 0 there would be a
claim about a ticker it does not own. The agent’s capture index and its
mikroscope_trigger_* counters live on the agent as well; the collector counts the
trigger markers it saw in mikroscope_.
What the collector adds
Section titled “What the collector adds”The collector’s own counters
Section titled “The collector’s own counters”| Family | Type | Carries |
|---|---|---|
mikroscope_ |
counter | ring gaps the collector saw: samples lost between pulls |
mikroscope_ |
counter | capture triggers the agent fired, per cause; present once one has been seen |
mikroscope_ |
counter | detection events per rule, every one of the eleven rules at 0 from the first scrape |
mikroscope_ |
counter | samples the derive stage flagged as a sub-sample burst |
Scroll sideways to see every column
Detections and bursts are counters so a Prometheus-only user learns of an event despite a missed scrape, and every rule is rendered at 0 from the start because a family that appears only after its first event cannot be read as “none so far”.
The derive stage
Section titled “The derive stage”| Family | Type | Carries |
|---|---|---|
mikroscope_ |
gauge | the allocator’s escalation ladder at the newest sample, 0 to 4 |
mikroscope_ |
gauge | PMU cycles per packet processed, summed over cores; absent without a PMU, in a sample with no packets, or after a counter reset |
mikroscope_ |
gauge | PMU instructions per packet, same conditions |
mikroscope_ |
gauge | PMU cache misses per packet, same conditions |
mikroscope_ |
gauge | packets per device interrupt; absent when the timer row was not in the sample’s top-K |
mikroscope_ |
gauge | fast-path share of the traffic the interface hands the CPU, between the last two counter polls; not a share of the wire; rx only while fp-tx-byte has never counted |
Scroll sideways to see every column
These are the newest sample’s values, a level at scrape time; the full series is in the stores that keep every sample. What each one means, and when it is withheld, is on what the collector derives.
The API tier
Section titled “The API tier”Present only once the API tier has delivered a sample; with --api-mode off or
without API credentials none of these families exists.
| Family | Type | Carries |
|---|---|---|
mikroscope_api_up |
gauge | 1 while the API tier delivers samples |
mikroscope_api_cpu_load |
gauge | RouterOS cpu-load from /system/resource |
mikroscope_ |
gauge | free and total from /system/resource |
mikroscope_ |
gauge | RouterOS uptime |
mikroscope_ |
gauge | per-core load, irq and disk percent from /system/resource/cpu |
mikroscope_ |
gauge | each /system/health reading |
mikroscope_ |
gauge | rx_bps, tx_bps, rx_pps, tx_pps from monitor-traffic, plus each loss rate the router returned |
mikroscope_ |
gauge | always 1; one series per interface from the configuration inventory: its comment, RouterOS type, interface lists, bridge and factory name |
mikroscope_ |
counter | every per-port cumulative counter the router returned, under RouterOS’s own counter name |
mikroscope_ |
gauge | the connection count, when --conntrack-every asks for it |
Scroll sideways to see every column
mikroscope_api_up is never rendered as 0: before the first API sample, and when the
tier is off, the family is absent.
The conntrack count, the port counters and the fast-path shares arrive on slower cadences than the scrape. The collector holds the last value of each between polls, so a scrape that lands between two polls still sees the family instead of a series that blinks in and out.
What each interface is
Section titled “What each interface is”The API tier reads what every interface is — its comment, RouterOS type, interface
lists, the bridge it is a port of, its factory name and its MTU — from three
configuration-only reads at collector start and again every --labels-every
(5 min by default). On /metrics that inventory is one info series per interface.
None of it is a label on the rate or counter series: a comment is edited by a human, and a changed label would start a fresh series for every rate and every one of the sixty-odd counters of that port on every edit. Join it in a query instead:
mikroscope_api_interface_counter_total * on(interface) group_left(label, type, role) mikroscope_api_interface_infoEvery interface in the inventory gets a series, with or without a comment; an empty
label value is how Prometheus spells “none”, so the label set is the same on all of
them. type says what the counters of that interface mean: an ether port in a
bridge counts its wire, including the frames the switch chip forwarded in hardware,
while the bridge counts its CPU side. Neither is a subset of the other — on the
reference RB5009 (RouterOS 7.24.2, 2026-09-16) ether1 received 255.8 GB on the wire
and handed 29.7 GB to the CPU — so do not sum a port and its bridge.
mikroscope_ has one series per port and counter the
router reports: 9 ports × about 60 counters on the reference RB5009. A counter a port
does not report has no series, and a loss rate the router did not return has no
kind. Keys that parse as integers but count nothing — mtu, actual-mtu,
l2mtu, max-l2mtu, sfp-shutdown-temperature — are sizes and configuration and
get no counter series; the MTU is part of the inventory. On the RB5009 with RouterOS
7.24.2 (2026-09-15) monitor-traffic returns rx-drops, tx-drops and
tx-queue-drops and no error keys at all.
Device-info families
Section titled “Device-info families”The collector’s exposition carries the same device-info families as the agent’s own
/metrics, from what it fetched from /capabilities: mikroscope_device_info, the
ceilings the board publishes (mikroscope_,
mikroscope_, mikroscope_,
mikroscope_, mikroscope_,
mikroscope_, mikroscope_) and
mikroscope_. See the device-info
stream.