Commit graph

11 commits

Author SHA1 Message Date
Warner Losh b144e70a33 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit fa9896e082)
2023-08-23 11:43:31 -06:00
Warner Losh 023fc80ee3 Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0e)
2023-08-23 11:43:30 -06:00
Warner Losh 3d497e17eb Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 1d386b48a5)
2023-08-23 11:43:26 -06:00
Alan Somers d58ced88d3 prometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI
They might belong to kernel modules not currently loaded, or to other
kernel versions.  Ignoring them allows the configuration to be shared
between multiple hosts.

Sponsored by:	Axcient
Reviewed by:	rew
Differential Revision: https://reviews.freebsd.org/D35540

(cherry picked from commit 982f980b86)
2022-08-19 21:01:43 -06:00
Alan Somers e4f508d5a2 prometheus_sysctl_exporter: fix metric aliasing
When exporting sysctls to Prometheus, the exporter replaces "." with
"_".  This caused several metrics to alias, confusing the Prometheus
server.  Fix it by:

* Renaming the "tcp_log_bucket" UMA zone to "tcp_log_id_bucket".  Also,
  rename "tcp_log_node" to "tcp_log_id_node" for consistency.

* Not exporting sysctls with "(LEGACY)" in the description.  That is
  used by ZFS sysctls that have been replaced by others, many of which
  alias to the same Prometheus metric name (like "vfs.zfs.arc_max" and
  "vfs.zfs.arc.max").

PR:		259607
Reported by:	delphij
Sponsored by:	Axcient
Reviewed by:	delphij,rew,thj
Differential Revision: https://reviews.freebsd.org/D34952

(cherry picked from commit 8c47d8f538)
2022-05-12 14:40:05 -06:00
Elyes HAOUAS 27fceea98c Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
(cherry picked from commit 9097ac9af4)
2021-12-06 08:55:55 -07:00
Robert Wing 0cfae878f0 prometheus_sysctl_exporter(8): filter output using a regex
Add two options, -i and -e, for filtering prometheus metrics.

Each option takes a regular expression as an argument. The provided
regex will be tested against the prometheus metric name.

The -i option includes metrics matching the given regex.
The -e option excludes metrics matching the given regex.

Sponsored by:   Modirum MDPay
Sponsored by:   Klara Inc.
Reviewed by:	0mp, debdrup
Differential Revision:	https://reviews.freebsd.org/D32269

(cherry picked from commit 8ff2b52241)
2021-10-10 10:15:18 -08:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Ed Schouten 4f6a15dd39 Be a bit more liberal about sysctl naming.
On the systems on which I tested this exporter, I never ran into metrics
that were named in such a way that they couldn't be exported to
Prometheus metrics directly. Now it turns out that on systems with NUMA,
the sysctl tree contains metrics named dev.${driver}.${index}.%domain.
For these metrics, the % in the name is problematic, as Prometheus
doesn't allow this symbol to be used.

Remove the assertions that were originally put in place to prevent the
exporter from generating malformed output and add code to deal with it
accordingly. For metric names, convert any unsupported character to an
underscore. For label values, perform string escaping.

PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221035
Reported by:	lifanov@
2017-07-29 08:35:07 +00:00
Bryan Drewery 6106a50ee6 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:14 +00:00
Ed Schouten de44cbc21d Add a Prometheus exporter for sysctl values.
Now that we have our sysctl tree annotated with aggregation labels,
let's go ahead and provide a very simple utility for exporting the
sysctl tree in Prometheus' format. It can either be used in conjunction
with the Prometheus node exporter or run through inetd(8).

The reason why I'm opting for having it in the base system is because it
has a pretty strong integration with some of sysctl's innards, such as
access to iterators, name lookups, metadata and type information. As I
am investigating whether we can add histograms as native types to sysctl
as well, this integration will only get stronger as we go along. That's
why it would be safer to oversee the development of this exporter
ourselves, as opposed to having it as an external project.

This exporter is remarkably compact, especially when compared to the
official Linux binary of the Prometheus node exporter (16 KB vs 12 MB).
I guess this could be an interesting aspect for monitoring embedded
FreeBSD-based systems.

Differential Revision:	https://reviews.freebsd.org/D8792
2016-12-21 08:29:44 +00:00