Remove empty label in harbor info

some infomation can not get with guest user. So remove them

Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
DQ 2021-01-20 10:53:55 +08:00
parent 92cf728371
commit c59b437970

View File

@ -17,10 +17,8 @@ var (
harborSysInfo = typedDesc{
desc: newDescWithLables("", "system_info", "Information of Harbor system",
"auth_mode",
"registry_url",
"external_url",
"harbor_version",
"registry_storage_provider"),
"self_registration"),
valueType: prometheus.GaugeValue,
}
)
@ -67,10 +65,8 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
json.NewDecoder(res.Body).Decode(&sysInfoResponse)
result = append(result, harborSysInfo.MustNewConstMetric(1,
sysInfoResponse.AuthMode,
sysInfoResponse.RegistryURL,
sysInfoResponse.ExternalURL,
sysInfoResponse.HarborVersion,
sysInfoResponse.StorageProvider))
sysInfoResponse.SelfRegistration))
if CacheEnabled() {
CachePut(systemInfoCollectorName, result)
}
@ -79,8 +75,6 @@ func (hc *SystemInfoCollector) getSysInfo() []prometheus.Metric {
type responseSysInfo struct {
AuthMode string `json:"auth_mode"`
RegistryURL string `json:"registry_url"`
ExternalURL string `json:"external_url"`
HarborVersion string `json:"harbor_version"`
StorageProvider string `json:"registry_storage_provider_name"`
SelfRegistration string `json:"self_registration"`
}