diff --git a/pkg/cloudmon/misc/system.go b/pkg/cloudmon/misc/system.go index 2412595fdf..fde388fb6d 100644 --- a/pkg/cloudmon/misc/system.go +++ b/pkg/cloudmon/misc/system.go @@ -17,7 +17,7 @@ package misc import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "time" @@ -74,7 +74,11 @@ func CollectServiceMetrics(ctx context.Context, userCred mcclient.TokenCredentia } metrics := []influxdb.SMetricData{} for _, ep := range endpoints { - if utils.IsInStringArray(ep.ServiceType, apis.NO_RESOURCE_SERVICES) || ep.ServiceType == apis.SERVICE_TYPE_IMAGE { + if utils.IsInStringArray(ep.ServiceType, apis.NO_RESOURCE_SERVICES) || utils.IsInStringArray(ep.ServiceType, []string{ + apis.SERVICE_TYPE_IMAGE, + apis.SERVICE_TYPE_MONITOR, + apis.SERVICE_TYPE_VICTORIA_METRICS, + }) { continue } url := httputils.JoinPath(ep.Url, "version") @@ -90,7 +94,7 @@ func CollectServiceMetrics(ctx context.Context, userCred mcclient.TokenCredentia continue } defer resp.Body.Close() - version, _ := ioutil.ReadAll(resp.Body) + version, _ := io.ReadAll(resp.Body) if len(version) == 0 { continue }