Compare commits

..

4 Commits

Author SHA1 Message Date
prombot
afbf9726d2 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2026-02-23 18:08:21 +00:00
PrometheusBot
1f2b81defd Synchronize common files from prometheus/prometheus (#2324) 2026-02-22 18:33:29 +00:00
renovate[bot]
219a32927f chore(deps): update actions/stale action to v10.2.0 (#2323)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-20 15:51:17 +01:00
Dominik Eisenberg
4bd8307c11 mscluster: rename windows_hyperv_hypervisor_virtual_processor_time_total -> windows_hyperv_hypervisor_virtual_processor_mode_time_total (#2322)
Signed-off-by: Dominik Eisenberg <d.business@outlook.de>
Signed-off-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
2026-02-19 22:19:30 +01:00
6 changed files with 61 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set docker hub repo name
@@ -42,7 +42,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set quay.io org name

View File

@@ -91,5 +91,5 @@ jobs:
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
# renovate: github=golangci/golangci-lint
version: v2.10.1
version: v2.7.2
args: "--max-same-issues=0"

View File

@@ -11,7 +11,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them

View File

@@ -11,7 +11,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them

View File

@@ -154,11 +154,11 @@ Some metrics explained: https://learn.microsoft.com/en-us/archive/blogs/chrisavi
### Hyper-V Hypervisor Virtual Processor
| Name | Description | Type | Labels |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|---------|--------------|
| `windows_hyperv_hypervisor_virtual_processor_time_total` | Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote) | counter | `vm`, `core` |
| `windows_hyperv_hypervisor_virtual_processor_total_run_time_total` | Time that processor spent | counter | `vm`, `core` |
| `windows_hyperv_hypervisor_virtual_processor_cpu_wait_time_per_dispatch_total` | The average time (in nanoseconds) spent waiting for a virtual processor to be dispatched onto a logical processor. | counter | `vm`, `core` |
| Name | Description | Type | Labels |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|---------|-----------------------|
| `windows_hyperv_hypervisor_virtual_processor_mode_time_total` | Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote) | counter | `vm`, `core`, `state` |
| `windows_hyperv_hypervisor_virtual_processor_run_time_total` | Time that processor spent | counter | `vm`, `core` |
| `windows_hyperv_hypervisor_virtual_processor_cpu_wait_time_per_dispatch_total` | The average time (in nanoseconds) spent waiting for a virtual processor to be dispatched onto a logical processor. | counter | `vm`, `core` |
### Hyper-V Virtual Network Adapter
@@ -265,19 +265,19 @@ _This collector does not yet have explained examples, we would appreciate your h
## Useful queries
Percent of physical CPU resources used per VM (on instance "localhost")
```
(sum (rate(windows_hyperv_hypervisor_virtual_processor_time_total{state="hypervisor",instance="localhost"}[1m]))) / ignoring(state,vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) / 100000
(sum (rate(windows_hyperv_hypervisor_virtual_processor_mode_time_total{state="hypervisor",instance="localhost"}[1m]))) / ignoring(state,vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) / 100000
```
Percent of physical CPU resources used by all VMs (on all monitored hosts)
```
(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_total_run_time_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) / 100000
(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_run_time_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) / 100000
```
Percent of physical CPU resources by the hosts themselves (on all monitored hosts)
```
(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_total_run_time_total{state="total"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_time_total{state="total"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
```
Percent of physical CPU resources by the hypervisor (on all monitored hosts)
```
(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_total_run_time_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_time_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) / 100000
```
## Alerting examples

View File

@@ -35,7 +35,9 @@ type collectorHypervisorVirtualProcessor struct {
// \Hyper-V Hypervisor Virtual Processor(*)\% Hypervisor Run Time
// \Hyper-V Hypervisor Virtual Processor(*)\% Remote Run Time
hypervisorVirtualProcessorTimeTotal *prometheus.Desc
hypervisorVirtualProcessorModeTimeTotal *prometheus.Desc // New name for better clarity
hypervisorVirtualProcessorTotalRunTimeTotal *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\% Total Run Time
hypervisorVirtualProcessorRunTimeTotal *prometheus.Desc // New name for better clarity
hypervisorVirtualProcessorContextSwitches *prometheus.Desc // \Hyper-V Hypervisor Virtual Processor(*)\CPU Wait Time Per Dispatch
}
@@ -59,16 +61,32 @@ func (c *Collector) buildHypervisorVirtualProcessor() error {
c.hypervisorVirtualProcessorTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_time_total"),
"DEPRECATED: use hypervisor_virtual_processor_mode_time_total. Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote)",
[]string{"vm", "core", "state"},
nil,
)
// New metric with better name for clarity, old one is kept for backward compatibility
c.hypervisorVirtualProcessorModeTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_mode_time_total"),
"Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote)",
[]string{"vm", "core", "state"},
nil,
)
// end same metric
c.hypervisorVirtualProcessorTotalRunTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_total_run_time_total"),
"DEPRECATED: use hypervisor_virtual_processor_run_time_total. Time that processor spent",
[]string{"vm", "core"},
nil,
)
// New metric with better name for clarity, old one is kept for backward compatibility
c.hypervisorVirtualProcessorRunTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_run_time_total"),
"Time that processor spent",
[]string{"vm", "core"},
nil,
)
// end same metric
c.hypervisorVirtualProcessorContextSwitches = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "hypervisor_virtual_processor_cpu_wait_time_per_dispatch_total"),
"The average time (in nanoseconds) spent waiting for a virtual processor to be dispatched onto a logical processor.",
@@ -120,14 +138,42 @@ func (c *Collector) collectHypervisorVirtualProcessor(ch chan<- prometheus.Metri
data.HypervisorVirtualProcessorRemoteRunTimePercent,
vmName, coreID, "remote",
)
// Same metric with new name for better clarity, old one is kept for backward compatibility
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorModeTimeTotal,
prometheus.CounterValue,
data.HypervisorVirtualProcessorHypervisorRunTimePercent,
vmName, coreID, "hypervisor",
)
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorModeTimeTotal,
prometheus.CounterValue,
data.HypervisorVirtualProcessorGuestRunTimePercent,
vmName, coreID, "guest",
)
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorModeTimeTotal,
prometheus.CounterValue,
data.HypervisorVirtualProcessorRemoteRunTimePercent,
vmName, coreID, "remote",
)
// end same metric
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorTotalRunTimeTotal,
prometheus.CounterValue,
data.HypervisorVirtualProcessorTotalRunTimePercent,
vmName, coreID,
)
// Same metric with new name for better clarity, old one is kept for backward compatibility
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorRunTimeTotal,
prometheus.CounterValue,
data.HypervisorVirtualProcessorTotalRunTimePercent,
vmName, coreID,
)
// end same metric
ch <- prometheus.MustNewConstMetric(
c.hypervisorVirtualProcessorContextSwitches,
prometheus.CounterValue,