certspotter-metrics(8)
π 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_DIRif that's set, or~/.certspotterotherwise. this should be the same directory used bycertspotter(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 bycertspotter_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 tocertspotter_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. seecertspotter(8)for more information.certspotter_log_health_check_failuresβ number of failed health checks certspotter has recorded for the log. seecertspotter(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 bycertspotter(8).STATE_DIRECTORYβ directory for storing state, if it's set andcertspotter-metricsis 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
- nixpkgs unstable: certspotter 0.25.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms