Skip to content

Commit

Permalink
Merge pull request prometheus-community#1051 from benridley/feature_v…
Browse files Browse the repository at this point in the history
…ersion_info

Export extra version information
  • Loading branch information
breed808 authored Aug 30, 2022
2 parents b5f9ee0 + 429835c commit 65a2baf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collector/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewOSCollector() (Collector, error) {
OSInformation: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "info"),
"OperatingSystem.Caption, OperatingSystem.Version",
[]string{"product", "version"},
[]string{"product", "version", "major_version", "minor_version", "build_number"},
nil,
),
PagingLimitBytes: prometheus.NewDesc(
Expand Down Expand Up @@ -236,6 +236,9 @@ func (c *OSCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metric) (
1.0,
fmt.Sprintf("Microsoft %s", pn), // Caption
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(
Expand Down

0 comments on commit 65a2baf

Please sign in to comment.