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

Add Hyper-V Hypervisor Logical Processor metrics #1034

Merged
merged 3 commits into from
Aug 24, 2022

Conversation

gloyka
Copy link
Contributor

@gloyka gloyka commented Jul 28, 2022

Add Win32_PerfRawData_HvStats_HyperVHypervisorLogicalProcessor WMI class to monitor Hyper-V Hypervisor Logical Processor. The class shows metrics for actual CPU utilization on hypervisor hosts.

This addresses #444

Example output:

# HELP windows_hyperv_host_lp_guest_run_time The percentage of time spent by the processor in guest code
# TYPE windows_hyperv_host_lp_guest_run_time gauge
windows_hyperv_host_lp_guest_run_time{core="0"} 4.288535665036e+12
windows_hyperv_host_lp_guest_run_time{core="1"} 3.8546816773e+11
# HELP windows_hyperv_host_lp_hypervisor_run_time The percentage of time spent by the processor in hypervisor code
# TYPE windows_hyperv_host_lp_hypervisor_run_time gauge
windows_hyperv_host_lp_hypervisor_run_time{core="0"} 9.95114252719e+11
windows_hyperv_host_lp_hypervisor_run_time{core="1"} 2.50063864275e+11
# HELP windows_hyperv_host_lp_total_run_time The percentage of time spent by the processor in guest and hypervisor code
# TYPE windows_hyperv_host_lp_total_run_time gauge
windows_hyperv_host_lp_total_run_time{core="0"} 5.283649917755e+12
windows_hyperv_host_lp_total_run_time{core="1"} 6.35532032005e+11

@gloyka gloyka requested a review from a team as a code owner July 28, 2022 17:45
Copy link
Contributor

@breed808 breed808 left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this! I've left one minor comment regarding the metric names, but everything else looks fine.

You'll want to rebase your branch on master in order to fix the broken CI job.

Apologies for the delay in reviewing this.

collector/hyperv.go Outdated Show resolved Hide resolved
@gloyka
Copy link
Contributor Author

gloyka commented Aug 21, 2022

Thank you very much!
I added "percent" suffix for metric names and rebase branch.

@gloyka gloyka requested a review from breed808 August 21, 2022 14:57
@breed808
Copy link
Contributor

Thanks for that! The changes look good, but it appears that your rebase has resulted in a couple of commits from master being included.

Could you drop the two dependency commits? A git rebase -i master will do the trick.

gloyka added 3 commits August 23, 2022 19:42
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
@gloyka gloyka force-pushed the master branch 2 times, most recently from 9a5993c to 37ea988 Compare August 23, 2022 16:43
@gloyka gloyka requested a review from breed808 August 23, 2022 16:47
@breed808 breed808 merged commit cdeceae into prometheus-community:master Aug 24, 2022
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
Add Hyper-V Hypervisor Logical Processor metrics
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