mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-24 05:36:36 +00:00
Add process_start_time_seconds for the exporter itself
This commit is contained in:
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