No version metrics when default metrics disabled
This commit is contained in:
parent
07dd31dea6
commit
0d4af2b71c
|
@ -1231,8 +1231,10 @@ func (e *Exporter) checkMapVersions(ch chan<- prometheus.Metric, server *Server)
|
||||||
versionDesc := prometheus.NewDesc(fmt.Sprintf("%s_%s", namespace, staticLabelName),
|
versionDesc := prometheus.NewDesc(fmt.Sprintf("%s_%s", namespace, staticLabelName),
|
||||||
"Version string as reported by postgres", []string{"version", "short_version"}, server.labels)
|
"Version string as reported by postgres", []string{"version", "short_version"}, server.labels)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(versionDesc,
|
if !e.disableDefaultMetrics {
|
||||||
prometheus.UntypedValue, 1, versionString, semanticVersion.String())
|
ch <- prometheus.MustNewConstMetric(versionDesc,
|
||||||
|
prometheus.UntypedValue, 1, versionString, semanticVersion.String())
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue