-
Notifications
You must be signed in to change notification settings - Fork 100
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
Use zipkin-go #123
Use zipkin-go #123
Conversation
0a767e9
to
fe8162f
Compare
what is the status of this? it looks like there is no code on the branch. was that by accident? |
Co-authored-by: José Carlos Cháve <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow so red!
hope to see the release version soon |
feat(zipkin_go): adds b3 propagation for http.
Tracer wrapping
This is pretty functional. Couple of questions:
|
So it seems we have a couple of removed features moving from native to wrapper:
So honestly I'm ok to merge without these items but they could pop up. I do think it would be better to launch with gRPC B3. |
chore: enables build for go 1.8.
Since they are deprecated I was thinking on waiting for someone to request for it? unless we see popular opentracing instrumentation using this? Otherwise I could add them.
True, this one is probably needed.
Worth to ping @hkshaw1990 here (to see if they are still using it). On the other hand, I see an issue here. The optional arguments for the NewTracer are the zipkin-go ones which means that making new arguments will feel weird. One option is to not to have such a |
There is quite some legacy code out there using the old log methods. My former company for instance... Bas |
+1
|
…tions feat: adds tracer native options.
…_ease_migration chore(zipkin): adds sampler type to ease migration.
i’ll try to look shortly... |
fix: changes the default propagation format.
i'll give it a try~ |
go 1.12 | ||
|
||
require ( | ||
github.com/gorilla/mux v1.7.3 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should not be here. It comes from the example.
I am glad to say that we have this branch running in a production service. |
1c927e5
to
447f2dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for deleting so much. I quickly looked at things and commented on what jumped out.
bench_test.go
Outdated
b.Fatalf("missing traces: expected %d, got %d", b.N, r) | ||
} | ||
} | ||
//func BenchmarkSpan_100BaggageItems(b *testing.B) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we don't support this yet and I would wait until extra fields take place in zipkin go.
same "printed page" as the copyright notice for easier | ||
identification within third-party archives. | ||
|
||
Copyright 2017 The OpenZipkin Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017-2019?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea on this but I copied it from zipkin-go. Should we change it there? https://github.com/openzipkin/zipkin-go/blob/master/LICENSE#L189
bench_test.go
Outdated
func BenchmarkInject_Binary_100BaggageItems(b *testing.B) { | ||
benchmarkInject(b, opentracing.Binary, 100) | ||
} | ||
// func BenchmarkInject_Binary_Empty(b *testing.B) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't support binary yet. Let's reintroduce it when it is supported.
bench_test.go
Outdated
func BenchmarkExtract_Binary_100BaggageItems(b *testing.B) { | ||
benchmarkExtract(b, opentracing.Binary, 100) | ||
} | ||
// func BenchmarkExtract_Binary_Empty(b *testing.B) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intentional?
propagation/http/http_test.go
Outdated
"github.com/openzipkin/zipkin-go/reporter/recorder" | ||
) | ||
|
||
func TestHTTPExtractFlagsOnly(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of this feels like copy/paste. is there a way to only test what's relevant here (employing the code from zipkin-go and only addressing wrapping concerns)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately we reuse a very simple thing from zipkin-go in this package but makes sense to revisit the test list.
recorder_test.go
Outdated
type CountingRecorder int32 | ||
|
||
func (c *CountingRecorder) RecordSpan(r RawSpan) { | ||
func (c *CountingRecorder) Send(span model.SpanModel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previous name is less distracting unless somehow the word send is interesting here. the type is recorder right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and we changed the name to fulfill the interface.
span_test.go
Outdated
assert.Equal(t, "x", spans[0].Name) | ||
assert.Equal(t, 3, len(spans[0].Annotations)) | ||
assert.Equal(t, map[string]string{"tag": "value"}, spans[0].Tags) | ||
assert.Equal(t, spans[0].Annotations[0].Value, "event:payload") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event: prefix is probably not helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
tracer_options.go
Outdated
// to allow deterministic sampling decisions to be made across different nodes. | ||
sampler zipkin.Sampler | ||
|
||
// unsampledNoop turns potentially expensive operations on unsampled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have this? it seems half of the sampled local thing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I understand the question. it is here because of compatibility but also because it is supported in zipkin-go unless you refer to the actual description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually why do we need to copy options from zipkin-go anyway? could you not have a funciton that takes a zipkin-go tracer (with options already applied) plus OT relevant options? It seems less maintenance.. or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or by compatibility do you mean that this option was here before so that's why. Anyway, I'll leave you to it. I think you know I find this api surprising especially to someone using OT when they can just use zipkin-go directly if worried about perf. I would be surprised if layered instrumentation do smart things routinely, that's all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, now I understand the question :). So, this option was already here: https://github.com/openzipkin-contrib/zipkin-go-opentracing/blob/master/tracer.go#L36 I just made the translation into the respectively part in zipkin-go.
I have removed many options that were here (most of them related to logs) and did not match zipkin-go but those easily having a counter part I kept.
BTW there is a method for wrapping an existing tracer: https://github.com/openzipkin-contrib/zipkin-go-opentracing/pull/123/files#diff-46db78603208f38452c0333bec12ab2cR57
I don't have strong feelings on keeping it or removing it but since we don't add any logic for this but to translate into zipkin option I'd rather keep it for retrocompatibility purposes.
I suppose I meant to say I'm surprised to see checking in of commented out
code. Would it be better to delete it then check it back in when we have
functionality? Or is it typical in go to comment out code?
|
maybe change CountingRecorder to CountingSender instead?
…On Sun, Aug 11, 2019 at 2:51 AM José Carlos Chávez ***@***.***> wrote:
@jcchavezs commented on this pull request.
________________________________
In recorder_test.go:
> type CountingRecorder int32
-func (c *CountingRecorder) RecordSpan(r RawSpan) {
+func (c *CountingRecorder) Send(span model.SpanModel) {
yes and we changed the name to fulfill the interface.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
not sure I understand the question. it is here because of compatibility but
also because it is supported in zipkin-go unless you refer to the actual
description.
Seems an odd api, unless there's a good reason to also export it here, I'd
leave it out as OT is already going to imply some wrapping above which will
probably obviate some of the cycles this feel it might save
|
…translation Adds support for tag translation
Right, it was just lazyness to not to need to dig into it when the functionality is back. I will remove it
Makes sense! |
…_for_tags chore: adds tag translations for tags.
… wrapping an existing zipkin tracer.
chore: removes the option to create a new tracer
refactoring of propagation handling
This PR aims to use zipkin-go library and turn this library into a bridge with opentracing rather than a native implementation. This provides multiple advantages, mostly the fact that v2 reporting will be supported and also that this bridge will be able to obtain all the benefits from the new features of zipkin-go.
Closes #125
Ping @stakhiv @basvanbeek @ONG-YA