Page MenuHomeFreeBSD

prometheus_sysctl_exporter: don't abort on bad labels
AcceptedPublic

Authored by kevans on Wed, Jul 1, 2:46 AM.
Tags
None
Referenced Files
F161665318: D57983.diff
Sun, Jul 5, 6:27 PM
Unknown Object (File)
Sun, Jul 5, 6:59 AM
Unknown Object (File)
Sun, Jul 5, 5:19 AM
Unknown Object (File)
Wed, Jul 1, 6:04 AM
Subscribers

Details

Reviewers
asomers
rew
peterj
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 Passed
Unit
No Test Coverage
Build Status
Buildable 74443
Build 71326: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Wed, Jul 1, 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.Thu, Jul 2, 3:33 AM