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

Upgrade to OpenTracing Go 1.2 #525

Merged
merged 2 commits into from Jul 31, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
69 changes: 3 additions & 66 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Expand Up @@ -4,7 +4,7 @@

[[constraint]]
name = "github.com/opentracing/opentracing-go"
version = "^1.1"
version = "^1.2"

[[constraint]]
name = "github.com/prometheus/client_golang"
Expand Down
49 changes: 28 additions & 21 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions glide.yaml
@@ -1,7 +1,7 @@
package: github.com/uber/jaeger-client-go
import:
- package: github.com/opentracing/opentracing-go
version: ^1.1
version: ^1.2
subpackages:
- ext
- log
Expand All @@ -18,7 +18,9 @@ import:
- package: github.com/uber-go/atomic
version: ^1
- package: github.com/prometheus/client_golang
version: ^1
version: 1.1
- package: github.com/prometheus/procfs
version: 0.0.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newer versions of Prom client have dependencies on libraries using go modules with v2, which does not work with glide. Since this is legacy anyway, I am pinning to the current versions (unfortunately glide doesn't allow updating a single dep).

testImport:
- package: github.com/stretchr/testify
subpackages:
Expand Down
7 changes: 4 additions & 3 deletions jaeger_thrift_span_test.go
Expand Up @@ -126,7 +126,7 @@ func TestBuildLogs(t *testing.T) {
{field: log.Uint64("k", 123), expected: []*j.Tag{{Key: "k", VType: j.TagType_LONG, VLong: &someLong}}},
{field: log.Float32("k", 123), expected: []*j.Tag{{Key: "k", VType: j.TagType_DOUBLE, VDouble: &someDouble}}},
{field: log.Float64("k", 123), expected: []*j.Tag{{Key: "k", VType: j.TagType_DOUBLE, VDouble: &someDouble}}},
{field: log.Error(errors.New(errString)), expected: []*j.Tag{{Key: "error", VType: j.TagType_STRING, VStr: &errString}}},
{field: log.Error(errors.New(errString)), expected: []*j.Tag{{Key: "error.object", VType: j.TagType_STRING, VStr: &errString}}},
{field: log.Object("k", someSlice), expected: []*j.Tag{{Key: "k", VType: j.TagType_STRING, VStr: &someSliceString}}},
{
field: log.Lazy(func(fv log.Encoder) {
Expand All @@ -146,7 +146,7 @@ func TestBuildLogs(t *testing.T) {
},
// this is a bit fragile, but ¯\_(ツ)_/¯
expected: []*j.Tag{
{Key: "error", VType: j.TagType_STRING, VStr: getStringPtr("non-even keyValues len: 1")},
{Key: "error.object", VType: j.TagType_STRING, VStr: getStringPtr("non-even keyValues len: 1")},
{Key: "function", VType: j.TagType_STRING, VStr: getStringPtr("LogKV")},
},
},
Expand Down Expand Up @@ -403,7 +403,8 @@ func compareTags(t *testing.T, expected, actual *j.Tag, testName string) {
return
}
if expected == nil || actual == nil {
assert.Fail(t, "one of the tags is nil", testName)
t.Logf("one of the tags is nil, test=%s, expected=%v, actual=%v", testName, expected, actual)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way assert.Fail prints the message was not helpful, so adding explicit log

assert.Fail(t, "one of the tags is nil")
return
}
assert.Equal(t, expected.Key, actual.Key, testName)
Expand Down
4 changes: 2 additions & 2 deletions zipkin_thrift_span_test.go
Expand Up @@ -142,7 +142,7 @@ func TestThriftSpanLogs(t *testing.T) {
{fields: fields(log.Float32("something", 123)), expected: `{"something":"123.000000"}`},
{fields: fields(log.Float64("something", 123)), expected: `{"something":"123.000000"}`},
{fields: fields(log.Error(errors.New("drugs are baaad, m-k"))),
expected: `{"error":"drugs are baaad, m-k"}`},
expected: `{"error.object":"drugs are baaad, m-k"}`},
{fields: fields(log.Object("something", 123)), expected: `{"something":"123"}`},
{
fields: fields(log.Lazy(func(fv log.Encoder) {
Expand All @@ -161,7 +161,7 @@ func TestThriftSpanLogs(t *testing.T) {
sp.LogKV("non-even number of arguments")
},
// this is a bit fragile, but ¯\_(ツ)_/¯
expected: `{"error":"non-even keyValues len: 1","function":"LogKV"}`,
expected: `{"error.object":"non-even keyValues len: 1","function":"LogKV"}`,
},
{
logFunc: func(sp opentracing.Span) {
Expand Down