mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-08 02:01:23 +00:00
Merge ce2f9089bd
into f8b7139174
This commit is contained in:
commit
d176796238
@ -655,9 +655,15 @@ func (e *Exporter) checkMapVersions(ch chan<- prometheus.Metric, server *Server)
|
||||
versionDesc := prometheus.NewDesc(fmt.Sprintf("%s_%s", namespace, staticLabelName),
|
||||
"Version string as reported by postgres", []string{"version", "short_version"}, server.labels)
|
||||
|
||||
var semanticVersionShort = semanticVersion.String()
|
||||
if semanticVersion.GE(semver.MustParse("10.0.0")) {
|
||||
var versionSplit = strings.Split(semanticVersion.String(), ".")
|
||||
semanticVersionShort = versionSplit[0] + "." + versionSplit[1]
|
||||
|
||||
}
|
||||
if !e.disableDefaultMetrics && server.master {
|
||||
ch <- prometheus.MustNewConstMetric(versionDesc,
|
||||
prometheus.UntypedValue, 1, versionString, semanticVersion.String())
|
||||
prometheus.UntypedValue, 1, versionString, semanticVersionShort)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user