Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Remove usage of go.opentelemetry.io/otel/attribute.Sortable #32303

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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