certspotter-metrics(8)

πŸ“¦ version 0.25.0, in nixpkgs unstable

πŸ’… NAME πŸ’…

ok so certspotter-metrics β€” she outputs Prometheus metrics about how certspotter's operation is going. that's literally her whole job, bestie ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

certspotter-metrics [-state_dir PATH]

πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea: certspotter-metrics reads a certspotter state directory and then writes out Prometheus metrics β€” in the Prometheus text exposition format, no less β€” all about how certspotter is progressing with monitoring each Certificate Transparency log. and where do those metrics go? standard output. that's it. that's the vibe. πŸ’–

the intended use (iykyk) is to run certspotter-metrics periodically β€” like, say, from cron β€” and expose the output to Prometheus, for example with the prometheus-node-exporter(1) textfile collector. iconic behavior fr fr.

and here's the part that matters, so listen up: certspotter-metrics only reads the state directory. it never modifies it. so it's totally safe to run while certspotter is running, and it also doesn't require certspotter to be running at all. flexible queen 🫢

metrics get output for every log for which certspotter has a state directory β€” that's $STATE_DIR/logs/LOG_ID, where LOG_ID is the base64url-encoded log ID. a log has a state directory once certspotter has started monitoring it. the log_id label on each metric is the standard base64 encoding (with padding) of the 32-byte log ID defined by RFC 6962. see https://sslmate.com/app/ctlogs for a list of human-friendly names for each log ID β€” super handy ngl 🧚

⚠️ real talk: certspotter-metrics is experimental, and the metrics may change in a future release. don't get too attached to the exact shape, bestie 😭

✨ OPTIONS ✨

  • -state_dir PATH β€” the directory where certspotter stores state. defaults to $CERTSPOTTER_STATE_DIR if that's set, or ~/.certspotter otherwise. this should be the same directory used by certspotter(8). like, same one. don't mix them up πŸ’…
  • -version β€” print version information and exit. short and sweet, we love a quick exit πŸ‘‘

🌈 METRICS 🌈

heads up: all metrics are gauges with a log_id label identifying the log the metric pertains to. and if a metric doesn't pertain to a log (because certspotter hasn't stored the relevant state for that log yet), the log just doesn't have a sample for that metric. no sample, no problem πŸ¦‹

  • certspotter_log_max_sth_size β€” tree size of the largest signed tree head (STH) certspotter has observed from the log β€” in other words, the number of entries in the log. absent if certspotter hasn't yet downloaded an STH from the log.
  • certspotter_log_max_sth_timestamp β€” timestamp, in milliseconds since the Epoch, of the STH reported by certspotter_log_max_sth_size.
  • certspotter_log_download_position β€” number of entries certspotter has downloaded from the log, including entries that haven't yet been verified.
  • certspotter_log_verified_position β€” number of entries certspotter has downloaded from the log and verified against an STH. verified? slay.
  • certspotter_log_verified_sth_timestamp β€” timestamp, in milliseconds since the Epoch, of the most recent STH certspotter has verified for the log. absent if certspotter hasn't verified an STH for the log. the size of this STH is equal to certspotter_log_verified_position. cute little factoid πŸ’–
  • certspotter_log_unverified_sths β€” number of unverified STHs certspotter is currently storing for the log.
  • certspotter_log_malformed_entries β€” number of malformed entries certspotter has recorded for the log. certspotter records an entry as malformed when it cannot parse the entry. see certspotter(8) for more information.
  • certspotter_log_health_check_failures β€” number of failed health checks certspotter has recorded for the log. see certspotter(8) for info about health checks. (yes, more certspotter lore, go read it)

🌸 EXAMPLES 🌸

a crontab(5) entry that exposes metrics to the node_exporter textfile collector every five minutes. and the reason it writes to a temp file and then renames it? so that node_exporter never reads a partially-written file. big brain energy 🧠✨

*/5 * * * * root certspotter-metrics > /var/lib/node_exporter/certspotter.prom.tmp && mv /var/lib/node_exporter/certspotter.prom.tmp /var/lib/node_exporter/certspotter.prom

a Prometheus query to determine download backlog β€” that's the number of entries in the log that haven't been downloaded yet:

certspotter_log_max_sth_size-certspotter_log_download_position

πŸ’œ ENVIRONMENT πŸ’œ

  • CERTSPOTTER_STATE_DIR β€” directory for storing state. overridden by -state_dir. defaults to ~/.certspotter. this should be the same directory used by certspotter(8).
  • STATE_DIRECTORY β€” directory for storing state, if it's set and certspotter-metrics is running under systemd.

⭐ EXIT STATUS ⭐

certspotter-metrics exits with status 0 on success, 1 on error, or 2 on invalid usage. simple. clean. periodt. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

certspotter(8) β€” go read it, i'm begging you πŸ™ˆ


and that's the whole page bestie!! this one's from the System Manager's Manual, dated 1980-01-01, and it's certspotter-metrics(8) β€” go forth and expose those metrics, you're gonna ate πŸ”₯πŸ’–

πŸ“¦ where this page comes from