Skip to content

Commit

Permalink
Depend on OTel 0.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
XSAM committed Mar 5, 2021
1 parent 2d2ab19 commit 5f4a773
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions instrumentation/database/sql/otelsql/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/semconv"
"go.opentelemetry.io/otel/trace"

Expand All @@ -43,7 +43,7 @@ type config struct {
DBSystem string

// Attributes will be set to each span.
Attributes []label.KeyValue
Attributes []attribute.KeyValue

// SpanNameFormatter will be called to produce span's name.
// Default use method as span name
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/database/sql/otelsql/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/semconv"
"go.opentelemetry.io/otel/trace"

Expand All @@ -37,7 +37,7 @@ func TestNewConfig(t *testing.T) {
),
SpanOptions: SpanOptions{Ping: true},
DBSystem: "db",
Attributes: []label.KeyValue{
Attributes: []attribute.KeyValue{
semconv.DBSystemKey.String(cfg.DBSystem),
},
SpanNameFormatter: &defaultSpanNameFormatter{},
Expand Down
8 changes: 4 additions & 4 deletions instrumentation/database/sql/otelsql/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/oteltest"
"go.opentelemetry.io/otel/semconv"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -236,7 +236,7 @@ func TestOtConn_ExecContext(t *testing.T) {
span := spanList[1]
assert.True(t, span.Ended())
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(append([]label.KeyValue{semconv.DBStatementKey.String("query")},
assert.Equal(t, attributesListToMap(append([]attribute.KeyValue{semconv.DBStatementKey.String("query")},
cfg.Attributes...)), span.Attributes())
assert.Equal(t, string(MethodConnExec), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestOtConn_QueryContext(t *testing.T) {
span := spanList[1]
assert.True(t, span.Ended())
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(append([]label.KeyValue{semconv.DBStatementKey.String("query")},
assert.Equal(t, attributesListToMap(append([]attribute.KeyValue{semconv.DBStatementKey.String("query")},
cfg.Attributes...)), span.Attributes())
assert.Equal(t, string(MethodConnQuery), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestOtConn_PrepareContext(t *testing.T) {
span := spanList[1]
assert.True(t, span.Ended())
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(append([]label.KeyValue{semconv.DBStatementKey.String("query")},
assert.Equal(t, attributesListToMap(append([]attribute.KeyValue{semconv.DBStatementKey.String("query")},
cfg.Attributes...)), span.Attributes())
assert.Equal(t, string(MethodConnPrepare), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
Expand Down
8 changes: 4 additions & 4 deletions instrumentation/database/sql/otelsql/example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ replace (

require (
github.com/go-sql-driver/mysql v1.5.0
go.opentelemetry.io/contrib/instrumentation/database/sql/otelsql v0.17.0
go.opentelemetry.io/otel v0.17.0
go.opentelemetry.io/otel/exporters/stdout v0.17.0
go.opentelemetry.io/otel/sdk v0.17.0
go.opentelemetry.io/contrib/instrumentation/database/sql/otelsql v0.18.0
go.opentelemetry.io/otel v0.18.0
go.opentelemetry.io/otel/exporters/stdout v0.18.0
go.opentelemetry.io/otel/sdk v0.18.0
)
32 changes: 16 additions & 16 deletions instrumentation/database/sql/otelsql/example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U=
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
go.opentelemetry.io/otel/exporters/stdout v0.17.0 h1:QfS/okW9h99eT7m20E9un/TDz+Q1woZADvAgUWR8YQI=
go.opentelemetry.io/otel/exporters/stdout v0.17.0/go.mod h1:NJ6kp8glOLKmXyjTM3I/ChQwUcE6rSdWd8AqGO/Av/w=
go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug=
go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4=
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
go.opentelemetry.io/otel/sdk v0.17.0 h1:eHXQwanmbtSHM/GcJYbJ8FyyH/sT9a0e+1Z9ZWkF7Ug=
go.opentelemetry.io/otel/sdk v0.17.0/go.mod h1:INs1PePjjF2hf842AXsxGTe5lH023QfLTZRFPiV/RUk=
go.opentelemetry.io/otel/sdk/export/metric v0.17.0 h1:RKOa26LDq4JBRwUnWwY64ccc27v1rA20z0q71aq4WFs=
go.opentelemetry.io/otel/sdk/export/metric v0.17.0/go.mod h1:G9SxRFvGmGpdmJ8TEXnTEnnRuR5p3cg/tRvWkA/XHvo=
go.opentelemetry.io/otel/sdk/metric v0.17.0 h1:l9W/OcHwyq3ZPqk4V6OS5ED50z9A6yI8N9gWeKS7zAY=
go.opentelemetry.io/otel/sdk/metric v0.17.0/go.mod h1:zAX55SrmDMpZwfQrz1PKIPbCP5beU+JPQTfNko01deo=
go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY=
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8=
go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78=
go.opentelemetry.io/otel/exporters/stdout v0.18.0 h1:DnB3C9IdAa3/6LqbpBYmO2QqljsBj3Mr2oSpIMnXbCc=
go.opentelemetry.io/otel/exporters/stdout v0.18.0/go.mod h1:c4vRVKdmtlGOnPriMiPhLzVzdMzH/RlM2NJioEhm+so=
go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY=
go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE=
go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo=
go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo=
go.opentelemetry.io/otel/sdk v0.18.0 h1:/UiFHiJxJyEoUN2tQ6l+5f0/P01V0G9YuHeVarktRDw=
go.opentelemetry.io/otel/sdk v0.18.0/go.mod h1:nT+UdAeGQWSeTnz9vY8BBq7SEGpmWAetyo/xHUcQvxo=
go.opentelemetry.io/otel/sdk/export/metric v0.18.0 h1:0CP4KxCGeaVO2l69NNzRCULaaGiW6UGPDSF/b6gRqDs=
go.opentelemetry.io/otel/sdk/export/metric v0.18.0/go.mod h1:CFUAd+HdaQT3efTnVFYaXXp56b6bFUqkck4iRB9wu0g=
go.opentelemetry.io/otel/sdk/metric v0.18.0 h1:16ryqzWeYMl6uzwz7or3IQlCDf366Ppfm50215Mte5I=
go.opentelemetry.io/otel/sdk/metric v0.18.0/go.mod h1:NY9c56grMpjqdaYvOFon8nnsgMPBaXpde5SO1ulDyCo=
go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk=
go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
8 changes: 4 additions & 4 deletions instrumentation/database/sql/otelsql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ replace go.opentelemetry.io/contrib => ../../../../

require (
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/contrib v0.17.0
go.opentelemetry.io/otel v0.17.0
go.opentelemetry.io/otel/oteltest v0.17.0
go.opentelemetry.io/otel/trace v0.17.0
go.opentelemetry.io/contrib v0.18.0
go.opentelemetry.io/otel v0.18.0
go.opentelemetry.io/otel/oteltest v0.18.0
go.opentelemetry.io/otel/trace v0.18.0
)
16 changes: 8 additions & 8 deletions instrumentation/database/sql/otelsql/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U=
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug=
go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4=
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY=
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8=
go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78=
go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY=
go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE=
go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo=
go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo=
go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk=
go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/database/sql/otelsql/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package otelsql

import (
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -43,7 +43,7 @@ func WithTracerProvider(provider trace.TracerProvider) Option {
}

// WithAttributes specifies attributes that will be set to each span.
func WithAttributes(attributes ...label.KeyValue) Option {
func WithAttributes(attributes ...attribute.KeyValue) Option {
return OptionFunc(func(cfg *config) {
cfg.Attributes = attributes
})
Expand Down
12 changes: 6 additions & 6 deletions instrumentation/database/sql/otelsql/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/oteltest"
)

Expand All @@ -39,12 +39,12 @@ func TestOptions(t *testing.T) {
{
name: "WithAttributes",
option: WithAttributes(
label.String("foo", "bar"),
label.String("foo2", "bar2"),
attribute.String("foo", "bar"),
attribute.String("foo2", "bar2"),
),
expectedConfig: config{Attributes: []label.KeyValue{
label.String("foo", "bar"),
label.String("foo2", "bar2"),
expectedConfig: config{Attributes: []attribute.KeyValue{
attribute.String("foo", "bar"),
attribute.String("foo2", "bar2"),
}},
},
{
Expand Down
14 changes: 7 additions & 7 deletions instrumentation/database/sql/otelsql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/semconv"
)

Expand All @@ -32,7 +32,7 @@ func init() {

func TestRegister(t *testing.T) {
driverName, err := Register("test-driver", "test-db",
WithAttributes(label.String("foo", "bar")),
WithAttributes(attribute.String("foo", "bar")),
)
require.NoError(t, err)
assert.Equal(t, "test-driver-otelsql-0", driverName)
Expand All @@ -43,9 +43,9 @@ func TestRegister(t *testing.T) {
otelDriver, ok := db.Driver().(*otDriver)
require.True(t, ok)
assert.Equal(t, &mockDriver{openConnectorCount: 2}, otelDriver.driver)
assert.ElementsMatch(t, []label.KeyValue{
assert.ElementsMatch(t, []attribute.KeyValue{
semconv.DBSystemKey.String("test-db"),
label.String("foo", "bar"),
attribute.String("foo", "bar"),
}, otelDriver.cfg.Attributes)

// Exceed max slot count
Expand All @@ -55,15 +55,15 @@ func TestRegister(t *testing.T) {

func TestWrapDriver(t *testing.T) {
driver := WrapDriver(newMockDriver(false), "test-db",
WithAttributes(label.String("foo", "bar")),
WithAttributes(attribute.String("foo", "bar")),
)

// Expected driver
otelDriver, ok := driver.(*otDriver)
require.True(t, ok)
assert.Equal(t, &mockDriver{}, otelDriver.driver)
assert.ElementsMatch(t, []label.KeyValue{
assert.ElementsMatch(t, []attribute.KeyValue{
semconv.DBSystemKey.String("test-db"),
label.String("foo", "bar"),
attribute.String("foo", "bar"),
}, otelDriver.cfg.Attributes)
}
6 changes: 3 additions & 3 deletions instrumentation/database/sql/otelsql/stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/semconv"
"go.opentelemetry.io/otel/trace"
)
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestOtStmt_ExecContext(t *testing.T) {
span := spanList[1]
assert.True(t, span.Ended())
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(append([]label.KeyValue{semconv.DBStatementKey.String("query")},
assert.Equal(t, attributesListToMap(append([]attribute.KeyValue{semconv.DBStatementKey.String("query")},
cfg.Attributes...)), span.Attributes())
assert.Equal(t, string(MethodStmtExec), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestOtStmt_QueryContext(t *testing.T) {
span := spanList[1]
assert.True(t, span.Ended())
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(append([]label.KeyValue{semconv.DBStatementKey.String("query")},
assert.Equal(t, attributesListToMap(append([]attribute.KeyValue{semconv.DBStatementKey.String("query")},
cfg.Attributes...)), span.Attributes())
assert.Equal(t, string(MethodStmtQuery), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/database/sql/otelsql/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -57,7 +57,7 @@ func (m *mockTx) Rollback() error {

var _ driver.Tx = (*mockTx)(nil)

var defaultLabel = label.Key("test").String("foo")
var defaultattribute = attribute.Key("test").String("foo")

func TestOtTx_Commit(t *testing.T) {
testCases := []struct {
Expand Down
18 changes: 9 additions & 9 deletions instrumentation/database/sql/otelsql/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/oteltest"
"go.opentelemetry.io/otel/trace"
)
Expand Down Expand Up @@ -78,8 +78,8 @@ func TestRecordSpanError(t *testing.T) {
}
}

func newTracerProvider() (*oteltest.StandardSpanRecorder, *oteltest.TracerProvider) {
var sr oteltest.StandardSpanRecorder
func newTracerProvider() (*oteltest.SpanRecorder, *oteltest.TracerProvider) {
var sr oteltest.SpanRecorder
provider := oteltest.NewTracerProvider(
oteltest.WithSpanRecorder(&sr),
)
Expand All @@ -95,16 +95,16 @@ func createDummySpan(ctx context.Context, tracer trace.Tracer) (context.Context,
func newMockConfig(tracer trace.Tracer) config {
return config{
Tracer: tracer,
Attributes: []label.KeyValue{defaultLabel},
Attributes: []attribute.KeyValue{defaultattribute},
SpanNameFormatter: &defaultSpanNameFormatter{},
}
}

func attributesListToMap(labels []label.KeyValue) map[label.Key]label.Value {
attributes := make(map[label.Key]label.Value)
func attributesListToMap(attributes []attribute.KeyValue) map[attribute.Key]attribute.Value {
attributesMap := make(map[attribute.Key]attribute.Value)

for _, v := range labels {
attributes[v.Key] = v.Value
for _, v := range attributes {
attributesMap[v.Key] = v.Value
}
return attributes
return attributesMap
}

0 comments on commit 5f4a773

Please sign in to comment.