fix: telemetry metric label variable (#18643)

This commit is contained in:
dreamweaverxyz 2023-12-07 03:18:01 +08:00 committed by GitHub
parent 0b907e8c54
commit 1ffe7d5481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,8 +76,8 @@ func New(cfg Config) (_ *Metrics, rerr error) {
return nil, nil
}
if numGlobalLables := len(cfg.GlobalLabels); numGlobalLables > 0 {
parsedGlobalLabels := make([]metrics.Label, numGlobalLables)
if numGlobalLabels := len(cfg.GlobalLabels); numGlobalLabels > 0 {
parsedGlobalLabels := make([]metrics.Label, numGlobalLabels)
for i, gl := range cfg.GlobalLabels {
parsedGlobalLabels[i] = NewLabel(gl[0], gl[1])
}