Page MenuHomeFreeBSD

prometheus_sysctl_exporter: don't abort on bad labels
ClosedPublic

Authored by kevans on Jul 1 2026, 2:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Aug 14, 3:53 PM
Unknown Object (File)
Fri, Aug 14, 3:53 PM
Unknown Object (File)
Fri, Aug 14, 3:53 PM
Unknown Object (File)
Fri, Aug 14, 3:47 PM
Unknown Object (File)
Wed, Aug 12, 7:18 PM
Unknown Object (File)
Sun, Aug 9, 3:16 PM
Unknown Object (File)
Sat, Aug 8, 5:37 PM
Unknown Object (File)
Sat, Aug 8, 4:01 PM
Subscribers

Details

Summary

We can probaby consider these kernel bugs, in which case asserting is
not the most helpful thing we can do. Let's emit the necessary details
to stderr and exit non-zero to aid debugging these without completely
blocking the ability to export all of the well-formed metrics.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Jul 1 2026, 2:46 AM

spelling nit - other than that, looks good

usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
504

spelling correction

Unrelated, I'm wondering if there's any interest in slightly refactoring this into a prometheus_fbsd_exporter (for lack of better name). Move the bits specific to sysctl output into a separate file and retain a prometheus_sysctl_exporter link to it, but it seems like there's a good opportunity to collect more stats and re-use the same basic CLI interface.

The ones that come to mind most immediately are:

  • BE metrics: used* stats for each boot environment, maybe
  • pfctl -s seems to have useful facts not currently broken out via sysctl, and I don't know that there's much appetite in doing so
  • Jail and VM stats? I guess jail_exporter already exists

Unrelated, I'm wondering if there's any interest in slightly refactoring this into a prometheus_fbsd_exporter (for lack of better name). Move the bits specific to sysctl output into a separate file and retain a prometheus_sysctl_exporter link to it, but it seems like there's a good opportunity to collect more stats and re-use the same basic CLI interface.

The ones that come to mind most immediately are:

  • BE metrics: used* stats for each boot environment, maybe
  • pfctl -s seems to have useful facts not currently broken out via sysctl, and I don't know that there's much appetite in doing so
  • Jail and VM stats? I guess jail_exporter already exists

yea, interesting

I did a pkg-search for prometheus exporters, there's quite a few of them...an NFS exporter, GEOM exporter

looks like there's a zfs-exporter or two on github

This revision is now accepted and ready to land.Jul 2 2026, 3:33 AM