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

Time metrics #532

Closed
basroovers opened this issue May 28, 2020 · 7 comments · Fixed by #639
Closed

Time metrics #532

basroovers opened this issue May 28, 2020 · 7 comments · Fixed by #639

Comments

@basroovers
Copy link
Contributor

basroovers commented May 28, 2020

Since node_exporter has time metrics, why does wmi_exporter not have them yet?
I've found Win32_PerfRawData_MicrosoftWindowsW32TimePerf_WindowsTimeService which has the following data:

  • ClockFrequencyAdjustment
  • ComputedTimeOffset
  • NTPClientTimeSourceCount
  • NTPRoundtripDelay
  • NTPServerIncomingRequests
  • NTPServerOutgoingResponses

The only thing stopping me from generating a collector is that the most important metric ComputedTimeOffset is a ulong, which is a 64-bit integer. (https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/ulong-data-type)

@carlpett
Copy link
Collaborator

Seems like an excellent addition. Are there performance counters we could read via perflib instead of WMI?

@basroovers
Copy link
Contributor Author

Aren't these performance counters? I mean I can also find them in the performance monitor.

\Windows Time Service\Clock Frequency Adjustment
\Windows Time Service\Computed Time Offset
\Windows Time Service\NTP Client Time Source Count
\Windows Time Service\NTP Roundtrip Delay
\Windows Time Service\NTP Server Incoming Requests
\Windows Time Service\NTP Server Outgoing Responses

@carlpett
Copy link
Collaborator

Most of the time there's a one-to-one mapping (and the main challenge is finding the mapping), but WMI also exposes a some stuff which doesn't have counters. So, nice that they are there. It is a lot more efficient to work with the counters rather than doing WMI queries, so we try to avoid adding new WMI classes (and are slowly converting existing collectors to use counters directly).

@basroovers
Copy link
Contributor Author

I would very much like to see this available very soon. What's the next step to make this happen?

@carlpett
Copy link
Collaborator

carlpett commented Jun 9, 2020

Well, the absolutely fastest way would be if you would be able to contribute the collector. The logical_disk collector could be a good template to start from. As you've already identified the counters you need, it should be fairly straightforward.
You can always submit a pull request which isn't complete if you need some pointers!

@tahachoura
Copy link

tahachoura commented Jul 15, 2021

Hi Dears,

I have an issue please : I added --collectors.enabled"time" to export NTP metrics, in order to monitor windows NTP server.
But all metrics are 0 , even though my NTP client is synchronised...

image

Any idea please ?

@breed808
Copy link
Contributor

@tahachoura could you open an issue for this please?

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

Successfully merging a pull request may close this issue.

4 participants