mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 14:06:38 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0333ee256 | ||
|
|
c9fc76de4c | ||
|
|
3752a547d5 | ||
|
|
0ab6c191be | ||
|
|
467e83722a | ||
|
|
7fe8ca8554 |
@@ -463,37 +463,37 @@ func NewHyperVCollector() (Collector, error) {
|
||||
AdapterBytesDropped: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "bytes_dropped"),
|
||||
"Bytes Dropped is the number of bytes dropped on the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
AdapterBytesReceived: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "bytes_received"),
|
||||
"Bytes received is the number of bytes received on the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
AdapterBytesSent: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "bytes_sent"),
|
||||
"Bytes sent is the number of bytes sent over the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
AdapterFramesDropped: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "frames_dropped"),
|
||||
"Frames Dropped is the number of frames dropped on the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
AdapterFramesReceived: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "frames_received"),
|
||||
"Frames received is the number of frames received on the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
AdapterFramesSent: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, buildSubsystemName("ethernet"), "frames_sent"),
|
||||
"Frames sent is the number of frames sent over the network adapter",
|
||||
nil,
|
||||
[]string{"adapter"},
|
||||
nil,
|
||||
),
|
||||
}, nil
|
||||
|
||||
@@ -30,37 +30,37 @@ func NewSystemCollector() (Collector, error) {
|
||||
return &SystemCollector{
|
||||
ContextSwitchesTotal: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "context_switches_total"),
|
||||
"PerfOS_System.ContextSwitchesPersec",
|
||||
"Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
ExceptionDispatchesTotal: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "exception_dispatches_total"),
|
||||
"PerfOS_System.ExceptionDispatchesPersec",
|
||||
"Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
ProcessorQueueLength: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "processor_queue_length"),
|
||||
"PerfOS_System.ProcessorQueueLength",
|
||||
"Length of processor queue (WMI source: PerfOS_System.ProcessorQueueLength)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
SystemCallsTotal: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "system_calls_total"),
|
||||
"PerfOS_System.SystemCallsPersec",
|
||||
"Total number of system calls (WMI source: PerfOS_System.SystemCallsPersec)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
SystemUpTime: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "system_up_time"),
|
||||
"SystemUpTime/Frequency_Object",
|
||||
"System boot time (WMI source: PerfOS_System.SystemUpTime)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
Threads: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "threads"),
|
||||
"PerfOS_System.Threads",
|
||||
"Current number of threads (WMI source: PerfOS_System.Threads)",
|
||||
nil,
|
||||
nil,
|
||||
),
|
||||
@@ -96,12 +96,12 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ContextSwitchesTotal,
|
||||
prometheus.GaugeValue,
|
||||
prometheus.CounterValue,
|
||||
float64(dst[0].ContextSwitchesPersec),
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ExceptionDispatchesTotal,
|
||||
prometheus.GaugeValue,
|
||||
prometheus.CounterValue,
|
||||
float64(dst[0].ExceptionDispatchesPersec),
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
@@ -111,7 +111,7 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.SystemCallsTotal,
|
||||
prometheus.GaugeValue,
|
||||
prometheus.CounterValue,
|
||||
float64(dst[0].SystemCallsPersec),
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
|
||||
16
exporter.go
16
exporter.go
@@ -44,6 +44,16 @@ var (
|
||||
[]string{"collector"},
|
||||
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
|
||||
@@ -65,6 +75,12 @@ func (coll WmiCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
wg.Done()
|
||||
}(name, c)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
startTimeDesc,
|
||||
prometheus.CounterValue,
|
||||
startTime,
|
||||
)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user