Skip to content

Commit

Permalink
Upgrade to OpenTracing Go 1.2 (#525)
Browse files Browse the repository at this point in the history
* Resolves #524
* Upgrades opentracing-go dependency to 1.2 (https://github.com/opentracing/opentracing-go/releases/tag/v1.2.0)
* Pin some Prometheus client libs in glide.yaml because some of their dependencies moved to go modules with v2, which is not supported by glide.

Signed-off-by: Yuri Shkuro <ys@uber.com>
  • Loading branch information
yurishkuro committed Jul 31, 2020
1 parent e65eb56 commit b58b8ea
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 95 deletions.
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
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)
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

0 comments on commit b58b8ea

Please sign in to comment.