-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add include and exclude filter for sensors in hwmon collector #3072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes #2242 This commit adds two new flags (`collector.hwmon.sensor-include` and `collector.hwmon.sensor-exclude`) to the `hwmon` collector to allow inclusion or exclusion of specific sensors. Some devices export nonsensical values for certain sensors. Here is an example: ``` node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp13"} 49.75 node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp15"} 3.892313987e+06 node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp16"} 3.892313987e+06 ``` As a user I would like to only exclude the values from these sensors, not necessarily of the complete device (as possible witht the `--collector.hwmon.chip-exclude` flag) as other sensor values might be sensical or desired. The new option filters based both on device name and sensor name, separated by an underscore. For example, to exclude the two sensors above, the following regex can be used: ~~~ --collector.hwmon.sensor-exclude="platform_nct6775_656_temp1[5,6]" ~~~ Signed-off-by: Simon Krenger <[email protected]>
SuperQ
reviewed
Jul 10, 2024
@SuperQ Signed-off-by: Simon Krenger <[email protected]>
discordianfish
approved these changes
Jul 14, 2024
SuperQ
approved these changes
Jul 14, 2024
v-zhuravlev
pushed a commit
to grafana/node_exporter
that referenced
this pull request
Nov 1, 2024
…heus#3072) * Add include and exclude filter for sensors in hwmon collector Fixes prometheus#2242 This commit adds two new flags (`collector.hwmon.sensor-include` and `collector.hwmon.sensor-exclude`) to the `hwmon` collector to allow inclusion or exclusion of specific sensors. Some devices export nonsensical values for certain sensors. Here is an example: ``` node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp13"} 49.75 node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp15"} 3.892313987e+06 node_hwmon_temp_celsius{chip="platform_nct6775_656",sensor="temp16"} 3.892313987e+06 ``` As a user I would like to only exclude these sensors, not necessarily the complete device (as is currently possible with the `--collector.hwmon.chip-exclude` flag) as other sensor values might be sensical or desired. The new option filters based both on device name and sensor name, separated by a semicolon. For example, to exclude the two sensors above, the following regex can be used: ~~~ --collector.hwmon.sensor-exclude="platform_nct6775_656;temp1[5,6]" ~~~ --------- Signed-off-by: Simon Krenger <[email protected]> Signed-off-by: Vitaly Zhuravlev <[email protected]>
SuperQ
added a commit
that referenced
this pull request
Feb 16, 2025
* [CHANGE] meminfo: Convert linux implementation to use procfs lib #3049 * [CHANGE] Update logging to use Go log/slog #3097 * [FEATURE] filesystem: Add `node_filesystem_mount_info` metric #2970 * [FEATURE] btrfs: Add metrics for commit statistics #3010 * [FEATURE] interrupts: Add collector include/exclude filtering #3028 * [FEATURE] interrupts: Add "exclude zeros" filtering #3028 * [FEATURE] slabinfo: Add filters for slab name. #3041 * [FEATURE] pressure: add IRQ PSI metrics #3048 * [FEATURE] hwmon: Add include and exclude filter for sensors #3072 * [FEATURE] filesystem: Add NetBSD support #3082 * [FEATURE] netdev: Add ifAlias label #3087 * [FEATURE] hwmon: Add Support for GPU Clock Frequencies #3093 * [FEATURE] Add `exclude[]` URL parameter #3116 * [FEATURE] Add AIX support #3136 * [FEATURE] filesystem: Add fs-types/mount-points include flags #3171 * [FEATURE] netstat: Add collector for tcp packet counters for FreeBSD. #3177 * [ENHANCEMENT] ethtool: Add logging for filtering flags #2979 * [ENHANCEMENT] netstat: Add TCPRcvQDrop to default metrics #3021 * [ENHANCEMENT] diskstats: Add block device rotational #3022 * [ENHANCEMENT] cpu: Support CPU online status #3032 * [ENHANCEMENT] arp: optimize interface name resolution #3133 * [ENHANCEMENT] textfile: Allow specifiying multiple directory globs #3135 * [ENHANCEMENT] filesystem: Add reporting of purgeable space on MacOS #3206 * [ENHANCEMENT] ethtool: Skip full scan of NetClass directories #3239 * [BUGFIX] zfs: Prevent `procfs` integer underflow #2961 * [BUGFIX] pressure: Fix collection on systems that do not expose a full CPU stat #3054 * [BUGFIX] cpu: Fix FreeBSD 32-bit host support and plug memory leak #3083 * [BUGFIX] hwmon: Add safety check to hwmon read #3134 * [BUGFIX] zfs: Allow space in dataset name #3186 Signed-off-by: Ben Kochie <[email protected]>
Merged
SuperQ
added a commit
that referenced
this pull request
Feb 17, 2025
* [CHANGE] meminfo: Convert linux implementation to use procfs lib #3049 * [CHANGE] Update logging to use Go log/slog #3097 * [FEATURE] filesystem: Add `node_filesystem_mount_info` metric #2970 * [FEATURE] btrfs: Add metrics for commit statistics #3010 * [FEATURE] interrupts: Add collector include/exclude filtering #3028 * [FEATURE] interrupts: Add "exclude zeros" filtering #3028 * [FEATURE] slabinfo: Add filters for slab name. #3041 * [FEATURE] pressure: add IRQ PSI metrics #3048 * [FEATURE] hwmon: Add include and exclude filter for sensors #3072 * [FEATURE] filesystem: Add NetBSD support #3082 * [FEATURE] netdev: Add ifAlias label #3087 * [FEATURE] hwmon: Add Support for GPU Clock Frequencies #3093 * [FEATURE] Add `exclude[]` URL parameter #3116 * [FEATURE] Add AIX support #3136 * [FEATURE] filesystem: Add fs-types/mount-points include flags #3171 * [FEATURE] netstat: Add collector for tcp packet counters for FreeBSD. #3177 * [ENHANCEMENT] ethtool: Add logging for filtering flags #2979 * [ENHANCEMENT] netstat: Add TCPRcvQDrop to default metrics #3021 * [ENHANCEMENT] diskstats: Add block device rotational #3022 * [ENHANCEMENT] cpu: Support CPU online status #3032 * [ENHANCEMENT] arp: optimize interface name resolution #3133 * [ENHANCEMENT] textfile: Allow specifiying multiple directory globs #3135 * [ENHANCEMENT] filesystem: Add reporting of purgeable space on MacOS #3206 * [ENHANCEMENT] ethtool: Skip full scan of NetClass directories #3239 * [BUGFIX] zfs: Prevent `procfs` integer underflow #2961 * [BUGFIX] pressure: Fix collection on systems that do not expose a full CPU stat #3054 * [BUGFIX] cpu: Fix FreeBSD 32-bit host support and plug memory leak #3083 * [BUGFIX] hwmon: Add safety check to hwmon read #3134 * [BUGFIX] zfs: Allow space in dataset name #3186 Signed-off-by: Ben Kochie <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2242
This commit adds two new flags (
collector.hwmon.sensor-include
andcollector.hwmon.sensor-exclude
) to thehwmon
collector to allow inclusion or exclusion of specific sensors.Some devices export nonsensical values for certain sensors. Here is an example:
As a user I would like to only exclude these sensors, not necessarily the complete device (as is currently possible with the
--collector.hwmon.chip-exclude
flag) as other sensor values might be sensical or desired.The new option filters based both on device name and sensor name, separated by a semicolon. For example, to exclude the two sensors above, the following regex can be used:
@SuperQ @discordianfish PTAL
Signed-off-by: Simon Krenger [email protected]