Skip to content

Conversation

@jj-asama
Copy link
Contributor

@jj-asama jj-asama commented Sep 18, 2025

I found these important for the observability tool I am building. Once this is merged, I will be adding these to the p8s collector as well.
Test case added from a Intel E810 NIC.

	NumaNode        *int32 // /sys/bus/pci/devices/<Location>/numa_node

	SriovDriversAutoprobe *bool   // /sys/bus/pci/devices/<Location>/sriov_drivers_autoprobe
	SriovNumvfs           *uint32 // /sys/bus/pci/devices/<Location>/sriov_numvfs
	SriovOffset           *uint32 // /sys/bus/pci/devices/<Location>/sriov_offset
	SriovStride           *uint32 // /sys/bus/pci/devices/<Location>/sriov_stride
	SriovTotalvfs         *uint32 // /sys/bus/pci/devices/<Location>/sriov_totalvfs
	SriovVfDevice         *uint32 // /sys/bus/pci/devices/<Location>/sriov_vf_device
	SriovVfTotalMsix      *uint64 // /sys/bus/pci/devices/<Location>/sriov_vf_total_msix

	D3coldAllowed *bool          // /sys/bus/pci/devices/<Location>/d3cold_allowed
	PowerState    *PciPowerState // /sys/bus/pci/devices/<Location>/power_state

I am not really interested in Offset, Stride VfDevice and MSI-X. Just added for completeness. Please let me know if I should rather remove them.

@discordianfish for your kind review.

ref: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci

Signed-off-by: Jain Johny <[email protected]>
Signed-off-by: Jain Johny <[email protected]>
support for sriov, numa and power management config
Signed-off-by: root <[email protected]>
Signed-off-by: Jain Johny <[email protected]>

// These files must exist in a device directory.
for _, f := range [...]string{"class", "vendor", "device", "subsystem_vendor", "subsystem_device", "revision"} {
for _, f := range [...]string{"class", "vendor", "device", "subsystem_vendor", "subsystem_device", "revision", "numa_node"} {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure numa_node is always going to exist? Even on older kernels? We tend to support some pretty old kernel versions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From 2.6.21 onwards as per
https://kernelnewbies.org/Linux_2_6_21
and
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=81bb0e198b4638ac65233b316f4588639dfe1fcd

But I think I made a mixup here. I used *int32 to make it optional. But added to this list of mandatory files. Will move it out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for double checking the versions. We used to support 2.6.32, but recently Go changed to >= 3.2.0.

So that works.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this mostly looks good. Question about the new required file.

Signed-off-by: Jain Johny <[email protected]>
@jj-asama
Copy link
Contributor Author

Thanks, this mostly looks good. Question about the new required file.
@SuperQ I have moved it to the other set of optional files.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SuperQ SuperQ merged commit d9d95c9 into prometheus:master Oct 21, 2025
7 checks passed
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.

2 participants