mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-28 21:37:31 +02:00
Fix sel registration in metric label
Original type is bool, should convert it to string Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
parent
7039e0d2fe
commit
23a02bd5a7
@ -2,6 +2,7 @@ package exporter
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/goharbor/harbor/src/lib/log"
|
"github.com/goharbor/harbor/src/lib/log"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
@ -66,7 +67,7 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
|
|||||||
result = append(result, harborSysInfo.MustNewConstMetric(1,
|
result = append(result, harborSysInfo.MustNewConstMetric(1,
|
||||||
sysInfoResponse.AuthMode,
|
sysInfoResponse.AuthMode,
|
||||||
sysInfoResponse.HarborVersion,
|
sysInfoResponse.HarborVersion,
|
||||||
sysInfoResponse.SelfRegistration))
|
strconv.FormatBool(sysInfoResponse.SelfRegistration)))
|
||||||
if CacheEnabled() {
|
if CacheEnabled() {
|
||||||
CachePut(systemInfoCollectorName, result)
|
CachePut(systemInfoCollectorName, result)
|
||||||
}
|
}
|
||||||
@ -76,5 +77,5 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
|
|||||||
type responseSysInfo struct {
|
type responseSysInfo struct {
|
||||||
AuthMode string `json:"auth_mode"`
|
AuthMode string `json:"auth_mode"`
|
||||||
HarborVersion string `json:"harbor_version"`
|
HarborVersion string `json:"harbor_version"`
|
||||||
SelfRegistration string `json:"self_registration"`
|
SelfRegistration bool `json:"self_registration"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user