mirror of
https://github.com/goharbor/harbor
synced 2025-04-26 05:23:04 +00: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 (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
|
||||
"github.com/goharbor/harbor/src/lib/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -66,7 +67,7 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
|
||||
result = append(result, harborSysInfo.MustNewConstMetric(1,
|
||||
sysInfoResponse.AuthMode,
|
||||
sysInfoResponse.HarborVersion,
|
||||
sysInfoResponse.SelfRegistration))
|
||||
strconv.FormatBool(sysInfoResponse.SelfRegistration)))
|
||||
if CacheEnabled() {
|
||||
CachePut(systemInfoCollectorName, result)
|
||||
}
|
||||
@ -76,5 +77,5 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
|
||||
type responseSysInfo struct {
|
||||
AuthMode string `json:"auth_mode"`
|
||||
HarborVersion string `json:"harbor_version"`
|
||||
SelfRegistration string `json:"self_registration"`
|
||||
SelfRegistration bool `json:"self_registration"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user