PROMETHEUS_SYSCTL_EXPORTER(8)
πΈ 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:
- 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. β¨ - The second method is to run this utility through
inetd(8). TCP port9124has been allocated for exactly this purpose. iykyk π₯
The following options are available:
-dβ print descriptions of metrics when available π-epattern β 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:-his required when running this utility throughinetd(8). Like, not optional, not a suggestion. Don't skip it.
-ipattern β if specified, include metrics that match pattern. The format of pattern is to be a regular expression as described inre_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:
- Prometheus project: https://prometheus.io/
- Prometheus exposition formats: https://prometheus.io/docs/instrumenting/exposition_formats/
- Prometheus node exporter: https://github.com/prometheus/node_exporter
- Prometheus default port allocations: https://github.com/prometheus/prometheus/wiki/Default-port-allocations
π 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2016 Nuxi, https://nuxi.nl/
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms