File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -356,21 +356,20 @@ func main() {
356
356
}
357
357
358
358
func parseMetricTypePrefixes (inputPrefixes []string ) (metricTypePrefixes []string ) {
359
- // drop duplicate prefixes
359
+ // Drop duplicate prefixes.
360
360
slices .Sort (inputPrefixes )
361
361
uniquePrefixes := slices .Compact (inputPrefixes )
362
362
363
- // drop prefixes that start with another existing prefix to avoid error:
364
- // "collected metric xxx was collected before with the same name and label values"
363
+ // Drop prefixes that start with another existing prefix to avoid error:
364
+ // "collected metric xxx was collected before with the same name and label values".
365
365
for i , prefix := range uniquePrefixes {
366
366
if i == 0 {
367
367
metricTypePrefixes = []string {prefix }
368
368
} else {
369
369
previousIndex := len (metricTypePrefixes ) - 1
370
370
371
- // current prefix starts with previous one
371
+ // Drop current prefix if it starts with the previous one.
372
372
if strings .HasPrefix (prefix , metricTypePrefixes [previousIndex ]) {
373
- // drop current prefix
374
373
continue
375
374
}
376
375
You can’t perform that action at this time.
0 commit comments