Prometheus
--prom :9124 makes the collector serve the Prometheus text
format (text/plain; version=0.0.4)
on GET /metrics at that address. Scrape the collector: the agent serves no
exposition of its own.
Kernel-tier families
Section titled “Kernel-tier families”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.
Scrape job
Section titled “Scrape job”The collector’s, and only the collector’s:
- job_name: "mikroscope" scrape_interval: 5s static_configs: [{ targets: ["<collector host>:9124"] }]This one job carries every family the dashboard asks for. What only a sampler
can know reaches the collector as data: the wake latency and read duration of
every tick ride in the sample itself, and GET /sampler answers the counters
that are not per-tick. There is nothing to double-count and no keep list to
maintain. The scrape intervals and Prometheus versions that have been run are
under Feature status.
Then the dashboard. The collector is scraped, so it cannot know the address Grafana queries:
give it in --grafana-datasource-url, or name a Prometheus datasource you already have in
--grafana-datasource-uid. Once Prometheus has scraped a few times:
export GRAFANA_TOKEN=…mikroscope dashboards publish --prom :9124 --grafana http://grafana:3000 \ --grafana-datasource-url http://prometheus:9090 # Prometheus as Grafana reaches itThe same --grafana flags on the collector publish at every start, as long as --prom is its
only sink with a dashboard: beside --influx or another, the datasource flags are refused, so
publish Prometheus this way. Or import it with dashboards import --store prometheus against a
datasource you already have (Datasource per
sink).
Family sources
Section titled “Family sources”| Family | Where it comes from |
|---|---|
| every kernel-tier family | folded from the samples, by the same code the agent used to run |
mikroscope_, _wake_latency_, _read_ |
folded from dt_ns, wake_ns and read_ns in each sample |
mikroscope_slipped_total, mikroscope_ |
the agent’s /sampler, read every minute |
mikroscope_, _suppressed_total |
the same, one series per configured condition, present at 0 |
mikroscope_captures_held, mikroscope_capture_bytes, mikroscope_, mikroscope_, mikroscope_ |
the same: what the agent holds, has served and has refused |
mikroscope_api_*, mikroscope_derived_*, _collector_* |
the collector’s own: the API tier, the derive stage, its counters |
Scroll sideways to see every column
The families read from /sampler are as fresh as the collector’s health cadence,
a minute, not as fresh as the scrape. For counters of fired triggers and held
captures that is the right resolution; anything per-tick travels in the samples
at full rate.
Collector-only families
Section titled “Collector-only families”Collector counters
Section titled “Collector 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”.
Derived families
Section titled “Derived families”| 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 Derived values.
API-tier families
Section titled “API-tier families”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_upis 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 between two polls still sees the family instead of a series that blinks in and out.
Interface inventory
Section titled “Interface inventory”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_info- Every interface in the inventory gets a series, with or without a comment. An
empty
labelvalue is how Prometheus spells “none” — its data model treats a label with an empty value as one that does not exist — so every series in the exposition carries the same label names. typesays what the counters of that interface mean: anetherport in a bridge counts its wire, including the frames the switch chip forwarded in hardware, while thebridgecounts its CPU side. Neither is a subset of the other — most of what a port receives can be switched in hardware and never reach the CPU (measured) — so do not sum a port and its bridge.mikroscope_has one series per port and counter the router reports: an Ethernet port reports several times more counters than a bridge, VLAN, PPPoE, WireGuard, veth or loopback interface (counted). A counter a port does not report has no series.api_ interface_ counter_ total - A loss rate the router did not return has no
kind, andmonitor-trafficcan return the drop rates with no error keys at all (verified). - 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.
Device-info families
Section titled “Device-info families”The collector’s exposition carries the device-info families from what it fetched from
/capabilities: mikroscope_device_info, the
ceilings the board publishes (mikroscope_,
mikroscope_, mikroscope_,
mikroscope_, mikroscope_,
mikroscope_, mikroscope_) and
mikroscope_. See Device
info.