Skip to content

Commit

Permalink
[chore] Remove usage of go.opentelemetry.io/otel/attribute.Sortable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax authored Apr 10, 2024
1 parent 8fb6db0 commit 1ad0b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions internal/aws/metrics/metric_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ type Key struct {

func NewKey(metricMetadata any, labels map[string]string) Key {
kvs := make([]attribute.KeyValue, 0, len(labels))
var sortable attribute.Sortable
for k, v := range labels {
kvs = append(kvs, attribute.String(k, v))
}
set := attribute.NewSetWithSortable(kvs, &sortable)
set := attribute.NewSet(kvs...)

dedupSortedLabels := set.Equivalent()
return Key{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,14 @@ func testStatsDMetric(
) statsDMetric {
if len(labelKeys) > 0 {
var kvs []attribute.KeyValue
var sortable attribute.Sortable
for n, k := range labelKeys {
kvs = append(kvs, attribute.String(k, labelValue[n]))
}
return statsDMetric{
description: statsDMetricDescription{
name: name,
metricType: metricType,
attrs: attribute.NewSetWithSortable(kvs, &sortable),
attrs: attribute.NewSet(kvs...),
},
asFloat: asFloat,
addition: addition,
Expand All @@ -638,14 +637,13 @@ func testStatsDMetric(

func testDescription(name string, metricType MetricType, keys []string, values []string) statsDMetricDescription {
var kvs []attribute.KeyValue
var sortable attribute.Sortable
for n, k := range keys {
kvs = append(kvs, attribute.String(k, values[n]))
}
return statsDMetricDescription{
name: name,
metricType: metricType,
attrs: attribute.NewSetWithSortable(kvs, &sortable),
attrs: attribute.NewSet(kvs...),
}
}

Expand Down

0 comments on commit 1ad0b31

Please sign in to comment.