From 8ff2b52241400f2b5c2287b91e6e12b97ffd5773 Mon Sep 17 00:00:00 2001 From: Robert Wing Date: Thu, 7 Oct 2021 17:00:27 -0800 Subject: 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 --- .../prometheus_sysctl_exporter.8 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8') diff --git a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 index f4ac44891ecb..7d73e3cab8cd 100644 --- a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 +++ b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd December 18, 2016 +.Dd October 7, 2021 .Dt PROMETHEUS_SYSCTL_EXPORTER 8 .Os .Sh NAME @@ -31,6 +31,8 @@ .Sh SYNOPSIS .Nm prometheus_sysctl_exporter .Op Fl dgh +.Op Fl e Ar pattern +.Op Fl i Ar pattern .Op Ar prefix ... .Sh DESCRIPTION Prometheus is a monitoring system that gathers metrics from its targets @@ -74,12 +76,26 @@ The following options are available: .Bl -tag -width indent .It Fl d Print descriptions of metrics when available. +.It Fl e Ar pattern +Same as +.Fl i , +except exclude metrics that match +.Ar pattern . .It Fl g Gzip compresses the HTTP response body. .It Fl h Precede the output with a HTTP response header. This flag is required when running this utility through .Xr inetd 8 . +.It Fl i Ar pattern +If specified, include metrics that match +.Ar pattern . +The format of +.Ar pattern +is to be a regular expression as described in +.Xr re_format 7 . +The provided regular expression is tested against the Prometheus +metric name. .El .Sh SEE ALSO .Xr cron 8 , -- cgit v1.2.3