mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-03 22:52:30 +02:00
Use slices.Sort in Prometheus exporter instead of sort.Slice (#4988)
This commit is contained in:
parent
7dea232a46
commit
32f3933456
@ -7,7 +7,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"unicode"
|
"unicode"
|
||||||
@ -313,9 +313,7 @@ func getAttrs(attrs attribute.Set, ks, vs [2]string, resourceKV keyVals) ([]stri
|
|||||||
values := make([]string, 0, attrs.Len())
|
values := make([]string, 0, attrs.Len())
|
||||||
for key, vals := range keysMap {
|
for key, vals := range keysMap {
|
||||||
keys = append(keys, key)
|
keys = append(keys, key)
|
||||||
sort.Slice(vals, func(i, j int) bool {
|
slices.Sort(vals)
|
||||||
return i < j
|
|
||||||
})
|
|
||||||
values = append(values, strings.Join(vals, ";"))
|
values = append(values, strings.Join(vals, ";"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user