mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-10 06:56:38 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0333ee256 | ||
|
|
c9fc76de4c | ||
|
|
3752a547d5 | ||
|
|
0ab6c191be | ||
|
|
467e83722a | ||
|
|
7fe8ca8554 | ||
|
|
4b3d1d60d9 | ||
|
|
1358123482 | ||
|
|
ec79488478 | ||
|
|
c3b227a4f2 | ||
|
|
c241513d56 | ||
|
|
5a538d7682 | ||
|
|
a0ec1e2da6 | ||
|
|
353de09798 | ||
|
|
afa17b2a1b | ||
|
|
3b88460eb5 |
@@ -13,6 +13,7 @@ ad | [Win32_PerfRawData_DirectoryServices_DirectoryServices](https://msdn.micros
|
|||||||
cpu | [Win32_PerfRawData_PerfOS_Processor](https://msdn.microsoft.com/en-us/library/aa394317(v=vs.90).aspx) metrics (cpu usage) | ✓
|
cpu | [Win32_PerfRawData_PerfOS_Processor](https://msdn.microsoft.com/en-us/library/aa394317(v=vs.90).aspx) metrics (cpu usage) | ✓
|
||||||
cs | [Win32_ComputerSystem](https://msdn.microsoft.com/en-us/library/aa394102) metrics (system properties, num cpus/total memory) | ✓
|
cs | [Win32_ComputerSystem](https://msdn.microsoft.com/en-us/library/aa394102) metrics (system properties, num cpus/total memory) | ✓
|
||||||
dns | [Win32_PerfRawData_DNS_DNS](https://technet.microsoft.com/en-us/library/cc977686.aspx) metrics (DNS Server) |
|
dns | [Win32_PerfRawData_DNS_DNS](https://technet.microsoft.com/en-us/library/cc977686.aspx) metrics (DNS Server) |
|
||||||
|
hyperv | Performance counters for Hyper-V hosts |
|
||||||
iis | [Win32_PerfRawData_W3SVC_WebService](https://msdn.microsoft.com/en-us/library/aa394345) IIS metrics |
|
iis | [Win32_PerfRawData_W3SVC_WebService](https://msdn.microsoft.com/en-us/library/aa394345) IIS metrics |
|
||||||
logical_disk | [Win32_PerfRawData_PerfDisk_LogicalDisk](https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71)) metrics (disk I/O) | ✓
|
logical_disk | [Win32_PerfRawData_PerfDisk_LogicalDisk](https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71)) metrics (disk I/O) | ✓
|
||||||
net | [Win32_PerfRawData_Tcpip_NetworkInterface](https://technet.microsoft.com/en-us/security/aa394340(v=vs.80)) metrics (network interface I/O) | ✓
|
net | [Win32_PerfRawData_Tcpip_NetworkInterface](https://technet.microsoft.com/en-us/security/aa394340(v=vs.80)) metrics (network interface I/O) | ✓
|
||||||
|
|||||||
1170
collector/hyperv.go
Normal file
1170
collector/hyperv.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -30,37 +30,37 @@ func NewSystemCollector() (Collector, error) {
|
|||||||
return &SystemCollector{
|
return &SystemCollector{
|
||||||
ContextSwitchesTotal: prometheus.NewDesc(
|
ContextSwitchesTotal: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "context_switches_total"),
|
prometheus.BuildFQName(Namespace, subsystem, "context_switches_total"),
|
||||||
"PerfOS_System.ContextSwitchesPersec",
|
"Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
ExceptionDispatchesTotal: prometheus.NewDesc(
|
ExceptionDispatchesTotal: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "exception_dispatches_total"),
|
prometheus.BuildFQName(Namespace, subsystem, "exception_dispatches_total"),
|
||||||
"PerfOS_System.ExceptionDispatchesPersec",
|
"Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
ProcessorQueueLength: prometheus.NewDesc(
|
ProcessorQueueLength: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "processor_queue_length"),
|
prometheus.BuildFQName(Namespace, subsystem, "processor_queue_length"),
|
||||||
"PerfOS_System.ProcessorQueueLength",
|
"Length of processor queue (WMI source: PerfOS_System.ProcessorQueueLength)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
SystemCallsTotal: prometheus.NewDesc(
|
SystemCallsTotal: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "system_calls_total"),
|
prometheus.BuildFQName(Namespace, subsystem, "system_calls_total"),
|
||||||
"PerfOS_System.SystemCallsPersec",
|
"Total number of system calls (WMI source: PerfOS_System.SystemCallsPersec)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
SystemUpTime: prometheus.NewDesc(
|
SystemUpTime: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "system_up_time"),
|
prometheus.BuildFQName(Namespace, subsystem, "system_up_time"),
|
||||||
"SystemUpTime/Frequency_Object",
|
"System boot time (WMI source: PerfOS_System.SystemUpTime)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
Threads: prometheus.NewDesc(
|
Threads: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "threads"),
|
prometheus.BuildFQName(Namespace, subsystem, "threads"),
|
||||||
"PerfOS_System.Threads",
|
"Current number of threads (WMI source: PerfOS_System.Threads)",
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
@@ -96,12 +96,12 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
|
|||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.ContextSwitchesTotal,
|
c.ContextSwitchesTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].ContextSwitchesPersec),
|
float64(dst[0].ContextSwitchesPersec),
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.ExceptionDispatchesTotal,
|
c.ExceptionDispatchesTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].ExceptionDispatchesPersec),
|
float64(dst[0].ExceptionDispatchesPersec),
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
@@ -111,7 +111,7 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
|
|||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.SystemCallsTotal,
|
c.SystemCallsTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(dst[0].SystemCallsPersec),
|
float64(dst[0].SystemCallsPersec),
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
|||||||
16
exporter.go
16
exporter.go
@@ -44,6 +44,16 @@ var (
|
|||||||
[]string{"collector"},
|
[]string{"collector"},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// This can be removed when client_golang exposes this on Windows
|
||||||
|
// (See https://github.com/prometheus/client_golang/issues/376)
|
||||||
|
startTime = float64(time.Now().Unix())
|
||||||
|
startTimeDesc = prometheus.NewDesc(
|
||||||
|
"process_start_time_seconds",
|
||||||
|
"Start time of the process since unix epoch in seconds.",
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Describe sends all the descriptors of the collectors included to
|
// Describe sends all the descriptors of the collectors included to
|
||||||
@@ -65,6 +75,12 @@ func (coll WmiCollector) Collect(ch chan<- prometheus.Metric) {
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
}(name, c)
|
}(name, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
startTimeDesc,
|
||||||
|
prometheus.CounterValue,
|
||||||
|
startTime,
|
||||||
|
)
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user