Skip to content

Metrics

The service exposes Prometheus metrics on /metrics at http.address. Two families cooperate:

  • rpz_* — pipeline metrics for the XFR loop itself: queries sent, failures, durations, last serial seen.
  • oxfeed_feed_* — service-level state from the shared feed writer: current published version, feed size on disk, optional in-memory pruning statistics.

pdns_platform_version_info carries the service version in a label for joins; it is always 1. The default Go runtime and process collectors (go_*, process_*) are also exposed but not listed here.

Label cardinality watch-out

All labelled metrics in this service carry only the bounded qtype label, which is one of AXFR or IXFR. There are no unbounded labels to watch — both the metric set and label set are constant for the lifetime of the process.

Is the downloader fetching from the upstream?

Metric Type Meaning
rpz_query_success_count Counter XFR queries that completed successfully. Labelled by qtype (AXFR or IXFR).
rpz_query_failure_count Counter XFR queries that produced a DNS-level error (response parse error, connection closed mid-stream). Labelled by qtype.
rpz_network_error_count Counter Connection-level failures from the underlying transport (dial / read / write timeouts, refused connections).
rpz_last_successful_query_timestamp_seconds Gauge Unix timestamp of the most recent successful XFR.

rpz_network_error_count increments on transient errors that the run loop retries; rpz_query_failure_count increments on errors that make it past the transport (truncated streams, invalid responses). Persistent network failure for longer than max_network_failure_duration causes the service to exit non-zero and be restarted by systemd.

Alert on staleness with the success timestamp:

# No successful XFR in the last hour.
time() - rpz_last_successful_query_timestamp_seconds > 3600

What version is being served?

Metric Type Meaning
rpz_last_soa_serial Gauge SOA serial of the most recent XFR. Tracks the upstream zone's published serial.
oxfeed_feed_current_version Gauge Latest internal feed version written (snapshot or delta). Monotonically increasing per instance.
oxfeed_feed_current_version_entries Gauge Number of domain entries in the latest snapshot written. NaN before the first snapshot.

rpz_last_soa_serial is the upstream-facing version; the oxfeed_feed_current_version is the internal counter visible to downstream clients. They drift apart in expected ways — a quiet upstream advances neither, a busy upstream advances the SOA serial several times between forced snapshots, and the local counter grows faster than the SOA when forced snapshots are written without any content change.

How fast are XFR queries?

Metric Type Meaning
rpz_iteration_duration_seconds Histogram Wall-clock duration of each successful XFR iteration, from "build query" to "delta written". Labelled by qtype.

AXFR durations dwarf IXFR. On a busy zone, expect AXFR p95 in the seconds-to-minutes range and IXFR p95 in milliseconds. Plot the two labels separately:

histogram_quantile(0.95,
  rate(rpz_iteration_duration_seconds_bucket{qtype="AXFR"}[5m]))

A sudden jump in IXFR duration usually means the upstream is sending a much larger delta than usual; a sudden jump in AXFR duration with no IXFR change usually means the upstream itself slowed down.

Is the feed tree growing as expected?

Metric Type Meaning
oxfeed_feed_size_bytes Gauge Total bytes occupied by snapshots, deltas, and feed-codes.json under feed.root.

This is the easiest signal for a runaway feed or a stuck expiry policy. If it grows monotonically over weeks the feed.expiry rules are too permissive. If feed.prune_enabled is off, the in-memory state may also be growing alongside it.

Is in-memory pruning recovering space?

These metrics are only meaningful when feed.prune_enabled is true.

Metric Type Meaning
oxfeed_feed_prune_call_total Counter Times the in-memory feed state was compacted.
oxfeed_feed_prune_saved_bytes_total Counter Bytes freed by those compactions, cumulative.

A prune_call_total rate close to zero on a long-running instance with pruning enabled means the mutation-based trigger never fires (the feed is small or stable) and the time-based trigger is doing the work. prune_saved_bytes_total not increasing means there is nothing to recover, and pruning can be turned back off.

Version metadata

Metric Type Meaning
pdns_platform_version_info Gauge Always 1. Carries the binary version in the version label for join queries.