mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-01-01 19:32:03 +00:00
Export extra version information
Adds major version, minor version, and build number as independent labels when exporting OS info. Signed-off-by: Ben Ridley <benridley29@gmail.com>
This commit is contained in:
parent
4b226cde40
commit
46fa84f9b0
@ -52,7 +52,7 @@ func NewOSCollector() (Collector, error) {
|
|||||||
OSInformation: prometheus.NewDesc(
|
OSInformation: prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(Namespace, subsystem, "info"),
|
prometheus.BuildFQName(Namespace, subsystem, "info"),
|
||||||
"OperatingSystem.Caption, OperatingSystem.Version",
|
"OperatingSystem.Caption, OperatingSystem.Version",
|
||||||
[]string{"product", "version"},
|
[]string{"product", "version", "major_version", "minor_version", "build_number"},
|
||||||
nil,
|
nil,
|
||||||
),
|
),
|
||||||
PagingLimitBytes: prometheus.NewDesc(
|
PagingLimitBytes: prometheus.NewDesc(
|
||||||
@ -236,6 +236,9 @@ func (c *OSCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (
|
|||||||
1.0,
|
1.0,
|
||||||
fmt.Sprintf("Microsoft %s", pn), // Caption
|
fmt.Sprintf("Microsoft %s", pn), // Caption
|
||||||
fmt.Sprintf("%d.%d.%s", nwgi.VersionMajor, nwgi.VersionMinor, bn), // Version
|
fmt.Sprintf("%d.%d.%s", nwgi.VersionMajor, nwgi.VersionMinor, bn), // Version
|
||||||
|
fmt.Sprintf("%d", nwgi.VersionMajor), // Major Version
|
||||||
|
fmt.Sprintf("%d", nwgi.VersionMinor), // Minor Version
|
||||||
|
bn, // Build number
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
Loading…
Reference in New Issue
Block a user