Skip to content

infiniband: apply device filters before reading counters - #3762

Draft
rafal-szypulka wants to merge 1 commit into
prometheus:masterfrom
rafal-szypulka:master
Draft

infiniband: apply device filters before reading counters#3762
rafal-szypulka wants to merge 1 commit into
prometheus:masterfrom
rafal-szypulka:master

Conversation

@rafal-szypulka

Copy link
Copy Markdown

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:

  1. obtains only the InfiniBand device names from procfs;
  2. applies the configured device filter;
  3. parses each accepted device individually.

Motivation

#3694 added:

  • --collector.infiniband.device-include
  • --collector.infiniband.device-exclude

However, the collector currently calls procfs.InfiniBandClass() before
applying 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 even
when 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.

Signed-off-by: Rafal Szypulka <rafal@datacrunch.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit which "pfs" when querying mellanox cards

1 participant