PROMETHEUS_SYSCTL_EXPORTER(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

🌸 NAME 🌸

prometheus_sysctl_exporter β€” okay so this is the girlie that prints your kernel state as Prometheus metrics πŸ’… (and yes, we're in section 8 of the System Manager's Manual, if you were wondering 🫢)

✨ SYNOPSIS ✨

prometheus_sysctl_exporter [-dgh] [-e pattern] [-i pattern] [prefix ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

First, the vibe check on Prometheus itself: it's a monitoring system that gathers metrics from its targets by fetching them through HTTP GET requests. Metrics are identified by a name and an optional set of labels. And here's the non-negotiable part, bestie β€” sample values are required to be numerical. No words, no vibes, just numbers. 😭

So what does prometheus_sysctl_exporter actually do? It prints the values of sysctl nodes to standard output, formatted such that they can be scraped by Prometheus directly. Iconic. By default it prints metrics for all numerically representable nodes in the sysctl namespace β€” the whole thing, no filter, no chill. But you can limit the output to a smaller number of metrics by specifying one or more prefixes as arguments. Slay.

The metrics it prints are named sysctl_, followed by the name of the sysctl node, except every . separator gets replaced by _. And the components on which it's desirable to aggregate (think: names of devices, stuff like that) get omitted from the metric's name β€” but don't worry, they're appended as labels instead. So nothing gets lost, it just moves to a different spot. πŸ‘‘

Now, there are two different methods for exporting the output of prometheus_sysctl_exporter to Prometheus, and you should know both:

  1. The first method is to periodically invoke this utility through cron(8) and store its output in a textfile. The metrics in that textfile can then be served over HTTP using the Prometheus node exporter's textfile collector. Very set-it-and-forget-it of you. ✨
  2. The second method is to run this utility through inetd(8). TCP port 9124 has been allocated for exactly this purpose. iykyk πŸ”₯

The following options are available:

  • -d β€” print descriptions of metrics when available πŸŽ€
  • -e pattern β€” same as -i, except it excludes metrics that match pattern
  • -g β€” gzip compresses the HTTP response body (smol output, big energy) πŸ’œ
  • -h β€” precede the output with a HTTP response header
🚨 Real talk: -h is required when running this utility through inetd(8). Like, not optional, not a suggestion. Don't skip it.
  • -i pattern β€” if specified, include metrics that match pattern. The format of pattern is to be a regular expression as described in re_format(7), and the regex you provide is tested against the Prometheus metric name. So write it for the metric name, not the raw sysctl path, bestie 🧚

🌈 SEE ALSO 🌈

And the links, because the Prometheus girlies keep receipts:

πŸŽ€ HISTORY πŸŽ€

prometheus_sysctl_exporter first appeared in FreeBSD 12.0. A whole era. ⭐

πŸ‘‘ AUTHORS πŸ‘‘

Nuxi: https://nuxi.nl/ β€” we stan 🫢


and that's the whole page, bestie πŸ’– brought to you by the Debian crew, dated October 7, 2021 β€” go forth and export those metrics, periodt 🌸

πŸ“¦ where this page comes from