infiniband: apply device filters before reading counters - #3762
Draft
rafal-szypulka wants to merge 1 commit into
Draft
infiniband: apply device filters before reading counters#3762rafal-szypulka wants to merge 1 commit into
rafal-szypulka wants to merge 1 commit into
Conversation
Signed-off-by: Rafal Szypulka <rafal@datacrunch.io>
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
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.
Important
Blocked by prometheus/procfs#854.
This PR must not be merged until the procfs change is merged and
node_exporter is updated to a procfs version containing the new APIs.
Summary
Apply the InfiniBand device include/exclude filter before reading device
attributes and counters.
The collector now:
Motivation
#3694 added:
--collector.infiniband.device-include--collector.infiniband.device-excludeHowever, the collector currently calls
procfs.InfiniBandClass()beforeapplying the filter.
InfiniBandClass()eagerly parses every device,including all per-port counters. The filter therefore controls emitted
metrics but does not prevent reads from excluded devices.
On systems with restricted or Fabric Manager-managed Mellanox PFs, those
reads can trigger repeated
mlx5_core ACCESS_REG(0x805)firmware errors evenwhen the device is excluded.
This change makes the flags perform filtering before any per-device reads,
which is necessary to address #3434.
Compatibility
With neither filter configured, all devices continue to be collected.
This depends on the new procfs device-listing and per-device parsing APIs.
Testing
The node_exporter and procfs branches were tested together using a Go
workspace and the collector test package cross-compiles successfully for
Linux.
Fixes #3434.