SaltDns.Metrics (Salt v1.0.0)

Prometheus metrics of the application, served at /metrics (SaltDnsWeb.MetricsController, bearer token SALT_DNS_METRICS_TOKEN).

The metrics are Telemetry.Metrics definitions rendered by TelemetryMetricsPrometheus.Core; no extra agent or port. Knot's own numbers (query rates, rate limiting, zone serials) come from the Knot exporter instead (docs/edge.md). The alert rules in deploy/examples/prometheus/alerts.yml use both, and every metric they name is listed here or comes from the exporter:

MetricMeaning
salt_dns_knot_sweep_failed_zoneszones the last full reconcile could not repair
salt_dns_knot_sweep_zoneszones the last full reconcile looked at
salt_dns_knot_drift_totalreconciles that found Knot different from Postgres
salt_dns_knot_drift_changes_totalrecords changed by those reconciles
salt_dns_knot_reconcile_total{result}reconciles by result (error is a failure)
salt_dns_knot_writer_failures_totalwriter attempts that failed (retried with backoff)
salt_dns_knot_writer_gaps_totalmissing change lists the writer had to repair
salt_dns_knot_writerszone writers alive: one per zone written to since start, idle or not (not a backlog)
salt_dns_knot_writers_busyzone writers with work not yet in Knot: dirty, buffered change lists or an unfinished removal
salt_dns_leader_epoch, salt_dns_leader_lease_age_milliseconds, salt_dns_leader_role (0 follower, 1 leader, 2 single), salt_dns_leader_knot_primarythe lease and the node's role (two nodes; the age is -1 on a follower)
salt_dns_leader_frozen_zonessigned zones frozen on this leader because their keys could not be imported
salt_dns_leader_frozen_oldest_secondsage of the oldest freeze: the signed copy lasts only until the zone's SOA expire time
salt_dns_leader_heartbeat_failed1 while the leader cannot write the Knot watchdog's heartbeat file
salt_dns_knot_signing_zoneson a follower: zones its Knot is configured to sign (must be 0; -1 where not asked)
salt_dns_dnssec_key_export_failed1 while the leader's key export fails
salt_dns_knot_catch_up_zones_totalzones the catch-up poll had to reconcile because no message arrived
salt_dns_failover_promoted_total, _demoted_total, _keys_missing_totaltakeovers, demotions, signed zones left unsigned for want of keys
salt_dns_ownership_checks_total{kind,outcome}ownership verifications by outcome
salt_dns_listener_requests_total{kind,result}RFC 2136 requests by rcode or TSIG error
salt_dns_dnssec_zoneszones with DNSSEC switched on
salt_dns_dnssec_zones_unpublishedof those, zones whose DNSKEY Knot does not publish
salt_dns_dnssec_ksk_ready_oldest_secondsage of the oldest KSK waiting for its DS to be confirmed
salt_dns_dnssec_status_errorsDNSSEC zones whose status could not be read
salt_dns_oban_jobs_failed_total{worker}failed Oban jobs
salt_dns_http_requests_total{status}web and API requests by status
salt_dns_certificate_expiry_timestamp_seconds{certificate}when the current version of a certificate expires (Unix time; certificate module)
salt_dns_certificate_consecutive_failures{certificate}failed attempts in a row since the last success
salt_dns_certificate_renewal_overdue_seconds{certificate}seconds since the provider's renewal window opened, while the certificate is not yet renewed (0 when none)
salt_dns_certificate_renewals_total{provider,result}orders by provider and result (issued, failed)
salt_dns_certificate_failures_total{provider,reason}failed orders by provider and kind of failure
salt_dns_certificate_order_duration_seconds{provider}histogram: time from order start to its end
salt_dns_certificate_challenge_wait_secondshistogram: time until every authoritative server had the DNS-01 records
salt_dns_certificate_provider_errors_total{provider}requests to a provider that failed
salt_dns_certificate_store_errors_total{operation}certificate store operations that failed
salt_dns_certificates{status}certificates by status
salt_dns_shaker_nodes{status}enrolled nodes by status (pending, active, retired)
salt_dns_shaker_nodes_connectednodes with an open Shaker connection on any replica
salt_dns_shaker_envelopes_total{kind}envelopes sent, by kind (state, certificate)
salt_dns_shaker_auth_failures_total{reason}refused socket authentications and bad status signatures
salt_dns_shaker_status_reports_total{result}verified status reports by ok/failed
salt_dns_shaker_node_seconds_since_status{hostname}seconds since each node's last verified status (bounded)
salt_dns_shaker_node_connected{hostname}1 while the node has an open connection, else 0 (bounded)
salt_dns_shaker_node_generations_behind{hostname}its group's generation minus the generation the node applied (0 when current)
salt_dns_shaker_node_serial_mismatches{hostname}certificates whose served serial differs from the expected one
salt_dns_shaker_node_status_errors{hostname}errors in the node's last status
salt_dns_shaker_node_seconds_since_ok_status{hostname}seconds since the node's last status with ok: true
salt_dns_proxy_group_generation{organisation,group}the group's generation (routing; SALT_DNS_SHAKER=on)
salt_dns_proxy_group_nodes_behind{organisation,group}active nodes behind the group's generation
salt_dns_proxy_group_routes_without_certificate{organisation,group}routes no current certificate covers
salt_dns_proxy_node_health_state{hostname,group}the node's state in the answers: 0 in, 1 out (by the checks), 2 drained by an operator (bounded)
salt_dns_proxy_probe_failures_total{signal}failed signals of health checks (connected, status, probe)
salt_dns_proxy_state_changes_total{to}changes of a node's state by the checks (in, out)
salt_dns_proxy_group_names_in_conflict{organisation,group}address names with a record Salt did not write, which it will not touch
salt_dns_proxy_group_kept_all_addresses{organisation,group}1 while the answers keep the addresses of all nodes because none was healthy
salt_dns_proxy_group_all_nodes_drained{organisation,group}1 while every node is drained by an operator (the last set stays)
salt_dns_proxy_family_unchecked{organisation,group,family}1 while Salt's own host cannot probe that address family (ipv4, ipv6) for the group: no route or no address of it. Its addresses are neither a failure nor a proof
salt_dns_proxy_group_prober_blind{organisation,group}1 while every probe from the checking replica fails for every node: it cannot judge and changes nothing

Summary

Functions

Children for the application's supervision tree.

Reads the DNSSEC status of every zone that has it switched on and reports what is stuck: zones whose DNSKEY Knot does not publish, KSKs waiting for their DS to be confirmed, and zones whose status could not be read.

The metric definitions.

Drops the per-certificate series (salt_dns_certificate_*{certificate}) whose label is not in live: a deleted or disabled certificate leaves the scrape at once instead of at the next restart. Returns how many series went.

The name of the reporter process.

The Prometheus exposition text.

Functions

children()

Children for the application's supervision tree.

measure_dnssec(now \\ System.os_time(:second), server \\ SaltDns.Knot.ConfigServer)

Reads the DNSSEC status of every zone that has it switched on and reports what is stuck: zones whose DNSKEY Knot does not publish, KSKs waiting for their DS to be confirmed, and zones whose status could not be read.

metrics()

The metric definitions.

prune_certificate_series(live)

@spec prune_certificate_series([String.t()]) :: non_neg_integer()

Drops the per-certificate series (salt_dns_certificate_*{certificate}) whose label is not in live: a deleted or disabled certificate leaves the scrape at once instead of at the next restart. Returns how many series went.

reporter()

The name of the reporter process.

scrape()

@spec scrape() :: String.t()

The Prometheus exposition text.