Summary: | prometheus_sysctl_exporter: Need better encoding support for sysctl OIDs | ||
---|---|---|---|
Product: | Base System | Reporter: | Xin LI <delphij> |
Component: | bin | Assignee: | Xin LI <delphij> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | asomers, devinrsmith, dor.bsd, freebsd, fs, grahamperrin, lwhsu |
Priority: | --- | Flags: | asomers:
mfc-stable13+
asomers: mfc-stable12- |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Xin LI
![]() ![]() Hi, Are these errors actually from the FreeBSD `prometheus_sysctl_exporter`? The `sysctl_` prefix suggests so. Node Exporter doesn't appear to export all of the sysctls anywhere and the metrics it does expose for ZFS and other sysctl based things are very specifically selected and named to avoid collisions. prometheus_sysctl_exporter does appear to show this unfortunate problem: $ prometheus_sysctl_exporter | grep l2arc | sort sysctl_vfs_zfs_l2arc_feed_again 1 sysctl_vfs_zfs_l2arc_feed_again 1 sysctl_vfs_zfs_l2arc_feed_min_ms 200 sysctl_vfs_zfs_l2arc_feed_min_ms 200 Are you using the Node Exporter to export these `prometheus_sysctl_exporter` metrics via the --collector.textfile.directory feature, perhaps? -David Thanks, I've created a patch for this at https://reviews.freebsd.org/D32886 . *** Bug 253862 has been marked as a duplicate of this bug. *** A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8c47d8f53854825d8e8591ccd06e32b2c798f81c commit 8c47d8f53854825d8e8591ccd06e32b2c798f81c Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2022-04-18 21:29:37 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2022-04-19 12:56:39 +0000 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 MFC after: 2 weeks Sponsored by: Axcient Reviewed by: delphij,rew,thj Differential Revision: https://reviews.freebsd.org/D34952 sys/netinet/tcp_log_buf.c | 33 +++++++++++----------- .../prometheus_sysctl_exporter.c | 11 ++++++-- 2 files changed, 26 insertions(+), 18 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f508d5a211e99dd6179794b51fefa329886be3 commit e4f508d5a211e99dd6179794b51fefa329886be3 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2022-04-18 21:29:37 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2022-05-12 20:40:05 +0000 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 8c47d8f53854825d8e8591ccd06e32b2c798f81c) sys/netinet/tcp_log_buf.c | 33 +++++++++++----------- .../prometheus_sysctl_exporter.c | 11 ++++++-- 2 files changed, 26 insertions(+), 18 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b524667411e93d1e828bbaca03d96bb8637a5357 commit b524667411e93d1e828bbaca03d96bb8637a5357 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2022-04-18 21:29:37 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2022-08-20 01:03:31 +0000 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 8c47d8f53854825d8e8591ccd06e32b2c798f81c) sys/netinet/tcp_log_buf.c | 33 +++++++++++----------- .../prometheus_sysctl_exporter.c | 11 ++++++-- 2 files changed, 26 insertions(+), 18 deletions(-) |