Skip to content
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

Metricbeat fstat on Windows always shows zero values #2842

Closed
Cylindric opened this issue Oct 25, 2016 · 16 comments
Closed

Metricbeat fstat on Windows always shows zero values #2842

Cylindric opened this issue Oct 25, 2016 · 16 comments
Assignees

Comments

@Cylindric
Copy link

I'm running metricbeat on a bunch of Windows servers as a test, and I am seeing ES records for each drive on the server, but the values are always zero.

"system": {
      "diskio": {
        "io": {
          "time": 0
        },
        "name": "E:",
        "read": {
          "bytes": 0,
          "count": 0,
          "time": 0
        },
        "write": {
          "bytes": 0,
          "count": 0,
          "time": 0
        }
      }
    }

I am using metricbeat version 5.0.0-rc1 (amd64), libbeat 5.0.0-rc1.

@andrewkroh
Copy link
Member

andrewkroh commented Oct 25, 2016

Is this for all drives? Or is it only for E:\? Is E:\ a CD-ROM? Are there any errors/warnings in Metricbeat log? What version of Windows are you running?

@stefanes
Copy link

stefanes commented May 9, 2017

Can confirm this behavior on all drives. I get the bytes (system.diskio.write.bytes and system.diskio.read.bytes) but no times, ever.

Beats are running on several Windows Server 2008 SP1 and 2012 R2 machines. Same behavior with both version 5.3.0 and 5.4.0. No errors in the metricbeat log, and nothing obvious in the elasticsearch log either.

@ruflin ruflin added the module label Feb 26, 2018
@consulthys
Copy link
Contributor

@ruflin any status on this? we have a case where write.bytes is always > 0 but read.bytes is always = 0.
Appreciate your input on this, thanks in advance

@ruflin
Copy link
Contributor

ruflin commented Sep 24, 2018

@consulthys I don't think any changes happened here. Any errors in the logs? Which Metricbeat version?

@consulthys
Copy link
Contributor

consulthys commented Sep 24, 2018

@ruflin no errors in the logs, read.bytes is simply always 0, which is weird. I'm using Metricbeat 6.4.0

@wheelq
Copy link

wheelq commented Oct 15, 2018

Same issue here

@jsoriano
Copy link
Member

@wheelq with what version of metricbeat and windows?

@wheelq
Copy link

wheelq commented Oct 29, 2018

latest :)

@jsoriano
Copy link
Member

We take these values directly from Win32_PerfFormattedData_PerfDisk_LogicalDisk class. I have found some reports of people with the same problem, zero values when querying this class. We'd need to investigate it further to see if we can find some workaround.

@wheelq
Copy link

wheelq commented Oct 30, 2018

Ok. What would you like me to provide you in order to investigate

@ruflin ruflin added the Team:Integrations Label for the Integrations team label Nov 21, 2018
@alvarolobato alvarolobato assigned jsoriano and unassigned jsoriano Dec 4, 2018
@bebeo92
Copy link

bebeo92 commented Mar 29, 2019

image
I also facing this issue, currently I using metricbeat latest 6 version with ES 5.6

@bebeo92
Copy link

bebeo92 commented Mar 29, 2019

@andrewkroh Is there any progress, this bug seem to be report so longggggggggggggggggggggggggggggggggggggggggggggggg

@narph narph self-assigned this Apr 1, 2019
@narph
Copy link
Contributor

narph commented Apr 1, 2019

@bebeo92, I suspect you might be hitting the file system cache in this case (https://docs.microsoft.com/en-us/windows/desktop/fileio/file-caching).
To rule this out (as I have encountered the same situation while reproducing), I suggest running any benchmark/performance monitoring tool (ex CrystalDiskMark) which will read/write directly on disk while you are collecting these metrics.
Keen to hear if the read/write values have increased and any additional details on your environment are more than welcome (os, type of disks, etc.)

narph added a commit to narph/beats that referenced this issue Apr 19, 2019
(SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk)

with DeviceIOControl Win32 API method using IOCTL_DISK_PERFORMANCE control code.

Fixes: elastic#3798 and elastic#2842
narph added a commit that referenced this issue Apr 26, 2019
* Replace using WMI query to get the system/diskio metrics for Windows

(SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk)

with DeviceIOControl Win32 API method using IOCTL_DISK_PERFORMANCE control code.

Fixes: #3798 and #2842

* Fixed cross platform build, added tests and include_devices filter

Added:
- include_devices filter to the IOCounters
- test file to assert get stats on C: returns data
- addressed houndci-bot style violations

* Fix goimports style

* Fix goimports styling

* Fix goimports and houndci-bot requests

* Fix support for osx

* Re-run build, address houndci-bot messages

* Update changelog file

* Addressed PR comments

* Addressing review notes

* Enrich test and implement separate function to enable the performance counters

* Add disable performance counters functionality for testing

* Log meesage when the EnableCounterForIoctl is added/updated in the registry

* Check for registry key value before updating it

* Address new code reviews

* small refactoring of deviceiocontrol functions
@narph
Copy link
Contributor

narph commented Apr 26, 2019

Replaced the current WMI query to get the system/diskio metrics for Windows
(SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk)
with DeviceIOControl Win32 API method using IOCTL_DISK_PERFORMANCE control code.
PR #11635
Should reflect the raw instead of the precalculated performance data from the counters that monitor logical partitions of a hard or fixed disk drive.

@bebeo92
Copy link

bebeo92 commented Apr 29, 2019

@andrewkroh sorry for late reply. I'm busy with other works
Currently I have 3 machine
1 have 16 core 32gb ram 1 ssd for os , 1 hdd
1 have 16 core 8gb ram 1 ssd for os
1 have 4 core 8gb ram 1 ssd for os , 1 hdd

All running on win 10

@bebeo92
Copy link

bebeo92 commented Apr 29, 2019

I saw there is a bug fix for it
One thing I forget to mention currently I using ES 5.x. I will try to test new package if it compatible with ES 5.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants