Skip to content

Commit

Permalink
Upgrade OTel to 0.19.0 (#3)
Browse files Browse the repository at this point in the history
* Upgrade OTel to 0.19.0

* Update CHANGELOG
  • Loading branch information
XSAM authored Mar 24, 2021
1 parent 55d84ad commit 5358456
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 68 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### Changed

- Upgrade to 0.19.0 of `go.opentelemetry.io/otel`. (#3)

## [0.1.0] - 2021-03-23

This is the first release of otelsql.
Expand Down
28 changes: 14 additions & 14 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ func TestOtConn_Ping(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodConnPing), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.pingCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.pingCtx))
Expand Down Expand Up @@ -239,8 +239,8 @@ func TestOtConn_ExecContext(t *testing.T) {
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)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.execContextCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.execContextCtx))
Expand Down Expand Up @@ -294,8 +294,8 @@ func TestOtConn_QueryContext(t *testing.T) {
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)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.queryContextCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.queryContextCtx))
Expand All @@ -310,9 +310,9 @@ func TestOtConn_QueryContext(t *testing.T) {

otelRows, ok := rows.(*otRows)
require.True(t, ok)
assert.Equal(t, dummySpan.SpanContext().TraceID, otelRows.span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().TraceID(), otelRows.span.SpanContext().TraceID())
// Span that creates in newRows() is the child of the dummySpan
assert.Equal(t, dummySpan.SpanContext().SpanID, otelRows.span.(*oteltest.Span).ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), otelRows.span.(*oteltest.Span).ParentSpanID())
}
})
}
Expand Down Expand Up @@ -355,8 +355,8 @@ func TestOtConn_PrepareContext(t *testing.T) {
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)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.prepareContextCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.prepareContextCtx))
Expand Down Expand Up @@ -413,8 +413,8 @@ func TestOtConn_BeginTx(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodConnBeginTx), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.beginTxCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.beginTxCtx))
Expand Down Expand Up @@ -470,8 +470,8 @@ func TestOtConn_ResetSession(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodConnResetSession), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mc.resetSessionCount)
assert.Equal(t, span.SpanContext(), trace.SpanContextFromContext(mc.resetSessionCtx))
Expand Down
8 changes: 4 additions & 4 deletions example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.15
replace github.com/XSAM/otelsql => ../

require (
github.com/XSAM/otelsql v0.18.0
github.com/XSAM/otelsql v0.19.0
github.com/go-sql-driver/mysql v1.5.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
go.opentelemetry.io/otel v0.19.0
go.opentelemetry.io/otel/exporters/stdout v0.19.0
go.opentelemetry.io/otel/sdk v0.19.0
)
38 changes: 18 additions & 20 deletions example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,29 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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/contrib v0.18.0 h1:uqBh0brileIvG6luvBjdxzoFL8lxDGuhxJWsvK3BveI=
go.opentelemetry.io/contrib v0.18.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
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=
go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg=
go.opentelemetry.io/otel/exporters/stdout v0.19.0 h1:6+QJvepCJ/YS3rOlsnjhVo527ohlPowOBgsZThR9Hoc=
go.opentelemetry.io/otel/exporters/stdout v0.19.0/go.mod h1:UI2JnNRaSt9ChIHkk4+uqieH27qKt9isV9e2qRorCtg=
go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg=
go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q=
go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA=
go.opentelemetry.io/otel/sdk v0.19.0 h1:13pQquZyGbIvGxBWcVzUqe8kg5VGbTBiKKKXpYCylRM=
go.opentelemetry.io/otel/sdk v0.19.0/go.mod h1:ouO7auJYMivDjywCHA6bqTI7jJMVQV1HdKR5CmH8DGo=
go.opentelemetry.io/otel/sdk/export/metric v0.19.0 h1:9A1PC2graOx3epRLRWbq4DPCdpMUYK8XeCrdAg6ycbI=
go.opentelemetry.io/otel/sdk/export/metric v0.19.0/go.mod h1:exXalzlU6quLTXiv29J+Qpj/toOzL3H5WvpbbjouTBo=
go.opentelemetry.io/otel/sdk/metric v0.19.0 h1:fka1Zc/lpRMS+KlTP/TRXZuaFtSjUg/maHV3U8rt1Mc=
go.opentelemetry.io/otel/sdk/metric v0.19.0/go.mod h1:t12+Mqmj64q1vMpxHlCGXGggo0sadYxEG6U+Us/9OA4=
go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
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
5 changes: 1 addition & 4 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ func initTracer() {
if err != nil {
log.Fatal(err)
}
cfg := sdktrace.Config{
DefaultSampler: sdktrace.AlwaysSample(),
}
tp := sdktrace.NewTracerProvider(
sdktrace.WithConfig(cfg),
sdktrace.WithSampler(sdktrace.AlwaysSample()),
sdktrace.WithSyncer(exporter),
)

Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ go 1.15

require (
github.com/stretchr/testify v1.7.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
go.opentelemetry.io/otel v0.19.0
go.opentelemetry.io/otel/oteltest v0.19.0
go.opentelemetry.io/otel/trace v0.19.0
)
22 changes: 10 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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/contrib v0.18.0 h1:uqBh0brileIvG6luvBjdxzoFL8lxDGuhxJWsvK3BveI=
go.opentelemetry.io/contrib v0.18.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
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=
go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg=
go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg=
go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1rU+ip2v9Q=
go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA=
go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
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 rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestNewRows(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodRows), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())
assert.Equal(t, mr, rows.Rows)
}
8 changes: 4 additions & 4 deletions stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func TestOtStmt_ExecContext(t *testing.T) {
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)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, ms.execCount)
assert.Equal(t, []driver.NamedValue{{Name: "test"}}, ms.ExecContextArgs)
Expand Down Expand Up @@ -166,8 +166,8 @@ func TestOtStmt_QueryContext(t *testing.T) {
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)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, ms.queryCount)
assert.Equal(t, []driver.NamedValue{{Name: "test"}}, ms.queryContextArgs)
Expand Down
8 changes: 4 additions & 4 deletions tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ func TestOtTx_Commit(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodTxCommit), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())

assert.Equal(t, 1, mt.commitCount)
if tc.error {
Expand Down Expand Up @@ -146,8 +146,8 @@ func TestOtTx_Rollback(t *testing.T) {
assert.Equal(t, trace.SpanKindClient, span.SpanKind())
assert.Equal(t, attributesListToMap(cfg.Attributes), span.Attributes())
assert.Equal(t, string(MethodTxRollback), span.Name())
assert.Equal(t, dummySpan.SpanContext().TraceID, span.SpanContext().TraceID)
assert.Equal(t, dummySpan.SpanContext().SpanID, span.ParentSpanID())
assert.Equal(t, dummySpan.SpanContext().TraceID(), span.SpanContext().TraceID())
assert.Equal(t, dummySpan.SpanContext().SpanID(), span.ParentSpanID())
assert.Equal(t, 1, mt.rollbackCount)

if tc.error {
Expand Down

0 comments on commit 5358456

Please sign in to comment.