Skip to content

diskstats_linux.go: add collector.diskstats.disable-queue-stats flag #3283

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Mar 26, 2025

Adds a flag to skip the call to SysBlockDeviceQueueStats in the diskstats collector, to improve performance over a large number of devices when the extra rotational label is not needed on the info metric.

Fixes #3282.

I don't have a strong preference on the naming or default, as long as it can be configured. In the PR, I named it collector.diskstats.disable-queue-stats defaulting to false, since this is probably an uncommon issue affecting systems with many (thousands) of block devices.

Skips call to `SysBlockDeviceQueueStats` to improve performance over a large number of devices.
@@ -65,6 +66,10 @@ const (
udevSCSIIdentSerial = "SCSI_IDENT_SERIAL"
)

var (
disableQueueStats = kingpin.Flag("collector.diskstats.disable-queue-stats", "disable queue stats").Default("false").Bool()
Copy link
Member

Choose a reason for hiding this comment

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

We usually prefer "positive" flags. Then the disable would be --no-collector.diskstats.enable-queue-stats

This makes the explicit version of the disable less awkward looking (--no-collector.diskstats.disable-queue-stats).

Suggested change
disableQueueStats = kingpin.Flag("collector.diskstats.disable-queue-stats", "disable queue stats").Default("false").Bool()
enableQueueStats = kingpin.Flag("collector.diskstats.enable-queue-stats", "enable queue stats").Default("true").Bool()

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.

If we can flip the boolean meaning, I'd be happy to get this into 1.9.1.

@SuperQ
Copy link
Member

SuperQ commented Mar 27, 2025

This needs a DCO sign-off. You can use git commit -s --amend to add it.

@SuperQ SuperQ mentioned this pull request Mar 27, 2025
@SuperQ
Copy link
Member

SuperQ commented Mar 31, 2025

Ping, are you able to finish this work?

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.

Performance regression in diskstats collector
2 participants