lib/promscrape: use strconv.Atoi instead of strconv.ParseInt for parsing -promscrape.cluster.memberNum

In this case there is no need in converting int64 to int
This commit is contained in:
Aliaksandr Valialkin 2022-06-01 01:42:30 +03:00
parent f5ef3806c9
commit d2567ccdd6
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -68,11 +68,11 @@ func mustInitClusterMemberID() {
if idx := strings.LastIndexByte(s, '-'); idx >= 0 {
s = s[idx+1:]
}
n, err := strconv.ParseInt(s, 10, 64)
n, err := strconv.Atoi(s)
if err != nil {
logger.Fatalf("cannot parse -promscrape.cluster.memberNum=%q: %s", *clusterMemberNum, err)
}
clusterMemberID = int(n)
clusterMemberID = n
}
// Config represents essential parts from Prometheus config defined at https://prometheus.io/docs/prometheus/latest/configuration/configuration/