-
Notifications
You must be signed in to change notification settings - Fork 706
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
Use Perflib for logical_disk exporter #400
Conversation
collector/logical_disk.go
Outdated
@@ -171,26 +170,25 @@ func (c *LogicalDiskCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus. | |||
// - https://msdn.microsoft.com/en-us/library/ms803973.aspx - LogicalDisk object reference | |||
type Win32_PerfRawData_PerfDisk_LogicalDisk struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of a nitpick, but now that we don't use WMI here, we don't need to have the type name match the WMI class name. We also don't need to export the type, so perhaps change to just logicalDisk
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, better to clean it up now then to leave others wondering at the type name in the future.
Are you happy to leave the documentation link for the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the doc link still looked relevant, but I didn't look super closely, is there something off with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at all. My preference would be to leave it in, as it is still largely relevant for the perflib metrics. Just checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type has been renamed to logicalDisk
. I've rebased the commits and force pushed them to my branch.
Latency metrics were previously exposing as ticks
LGTM, thanks! |
Use Perflib for logical_disk exporter
PR modifies the logical_disk exporter to use Perflib in place of WMI. The PR also fixes value format for several latency metrics (ticks -> seconds).
However, perflib is reporting
% Free Space
as the number of free megabytes (identical toFree Megabytes
), breaking theTotalSpace
metric.I've opened an issue in the perflib_exporter repository regarding this: leoluk/perflib_exporter/issues/23