mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-01 08:06:38 +00:00
Added percent suffix for metric names
Signed-off-by: Anton Akhmedzyanov <gloin@gloin.ru>
This commit is contained in:
@@ -54,9 +54,9 @@ type HyperVCollector struct {
|
|||||||
VirtualProcessors *prometheus.Desc
|
VirtualProcessors *prometheus.Desc
|
||||||
|
|
||||||
// Win32_PerfRawData_HvStats_HyperVHypervisorLogicalProcessor
|
// Win32_PerfRawData_HvStats_HyperVHypervisorLogicalProcessor
|
||||||
HostLPGuestRunTime *prometheus.Desc
|
HostLPGuestRunTimePercent *prometheus.Desc
|
||||||
HostLPHypervisorRunTime *prometheus.Desc
|
HostLPHypervisorRunTimePercent *prometheus.Desc
|
||||||
HostLPTotalRunTime *prometheus.Desc
|
HostLPTotalRunTimePercent *prometheus.Desc
|
||||||
|
|
||||||
// Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor
|
// Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor
|
||||||
HostGuestRunTime *prometheus.Desc
|
HostGuestRunTime *prometheus.Desc
|
||||||
@@ -314,20 +314,20 @@ func NewHyperVCollector() (Collector, error) {
|
|||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
HostLPGuestRunTime: prometheus.NewDesc(
|
HostLPGuestRunTimePercent: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "guest_run_time"),
|
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "guest_run_time_percent"),
|
||||||
"The percentage of time spent by the processor in guest code",
|
"The percentage of time spent by the processor in guest code",
|
||||||
[]string{"core"},
|
[]string{"core"},
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
HostLPHypervisorRunTime: prometheus.NewDesc(
|
HostLPHypervisorRunTimePercent: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "hypervisor_run_time"),
|
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "hypervisor_run_time_percent"),
|
||||||
"The percentage of time spent by the processor in hypervisor code",
|
"The percentage of time spent by the processor in hypervisor code",
|
||||||
[]string{"core"},
|
[]string{"core"},
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
HostLPTotalRunTime: prometheus.NewDesc(
|
HostLPTotalRunTimePercent: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "total_run_time"),
|
prometheus.BuildFQName(Namespace, buildSubsystemName("host_lp"), "total_run_time_percent"),
|
||||||
"The percentage of time spent by the processor in guest and hypervisor code",
|
"The percentage of time spent by the processor in guest and hypervisor code",
|
||||||
[]string{"core"},
|
[]string{"core"},
|
||||||
nil,
|
nil,
|
||||||
@@ -1058,21 +1058,21 @@ func (c *HyperVCollector) collectHostLPUsage(ch chan<- prometheus.Metric) (*prom
|
|||||||
coreId := parts[2]
|
coreId := parts[2]
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.HostLPGuestRunTime,
|
c.HostLPGuestRunTimePercent,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
float64(obj.PercentGuestRunTime),
|
float64(obj.PercentGuestRunTime),
|
||||||
coreId,
|
coreId,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.HostLPHypervisorRunTime,
|
c.HostLPHypervisorRunTimePercent,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
float64(obj.PercentHypervisorRunTime),
|
float64(obj.PercentHypervisorRunTime),
|
||||||
coreId,
|
coreId,
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.HostLPTotalRunTime,
|
c.HostLPTotalRunTimePercent,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
float64(obj.PercentTotalRunTime),
|
float64(obj.PercentTotalRunTime),
|
||||||
coreId,
|
coreId,
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ Name | Description | Type | Labels
|
|||||||
`windows_hyperv_root_partition_virtual_tlb_pages` | _Not yet documented_ | counter | None
|
`windows_hyperv_root_partition_virtual_tlb_pages` | _Not yet documented_ | counter | None
|
||||||
`windows_hyperv_hypervisor_virtual_processors` | _Not yet documented_ | counter | None
|
`windows_hyperv_hypervisor_virtual_processors` | _Not yet documented_ | counter | None
|
||||||
`windows_hyperv_hypervisor_logical_processors` | _Not yet documented_ | counter | None
|
`windows_hyperv_hypervisor_logical_processors` | _Not yet documented_ | counter | None
|
||||||
`windows_hyperv_host_lp_guest_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_lp_guest_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||||
`windows_hyperv_host_lp_hypervisor_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_lp_hypervisor_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||||
`windows_hyperv_host_lp_total_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_lp_total_run_time_percent` | _Not yet documented_ | counter | `core`
|
||||||
`windows_hyperv_host_cpu_guest_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_cpu_guest_run_time` | _Not yet documented_ | counter | `core`
|
||||||
`windows_hyperv_host_cpu_hypervisor_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_cpu_hypervisor_run_time` | _Not yet documented_ | counter | `core`
|
||||||
`windows_hyperv_host_cpu_remote_run_time` | _Not yet documented_ | counter | `core`
|
`windows_hyperv_host_cpu_remote_run_time` | _Not yet documented_ | counter | `core`
|
||||||
@@ -123,7 +123,7 @@ Percent of physical CPU resources by the hosts themselves (on all monitored host
|
|||||||
```
|
```
|
||||||
Percent of physical CPU resources by the hypervisor (on all monitored hosts)
|
Percent of physical CPU resources by the hypervisor (on all monitored hosts)
|
||||||
```
|
```
|
||||||
(sum by (instance)(rate(windows_hyperv_host_lp_total_run_time{}[1m]))) / sum by (instance)(windows_hyperv_hypervisor_logical_processors{}) / 100000
|
(sum by (instance)(rate(windows_hyperv_host_lp_total_run_time_percent{}[1m]))) / sum by (instance)(windows_hyperv_hypervisor_logical_processors{}) / 100000
|
||||||
```
|
```
|
||||||
|
|
||||||
## Alerting examples
|
## Alerting examples
|
||||||
|
|||||||
Reference in New Issue
Block a user