-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Introduces LOCAL_COMPONENT("lc") binary annotation and example use-case #821
Conversation
Note that finagle instrumentation doesn't yet support Span.duration. The workaround until that's not the case is add a ClientRecv("cr") annotation. That's because finagle needs some signal to know the span is complete. https://github.com/twitter/finagle/blob/develop/finagle-zipkin/src/main/scala/com/twitter/finagle/zipkin/thrift/DeadlineSpanMap.scala#L110 |
Does this change require UI/JS changes? When I emit a span with LC only, without RPC-bounding annotations, the UI doesn't show it. |
Make sure you are setting Span.timestamp, duration? The example of
bootstrap tracing displays...
|
|
||
/** If the span transport is set, trace accordingly, or disable tracing */ | ||
/** If the span transport is set, trace accordingly, or disable tracing. */ | ||
def premain { |
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.
@yurishkuro this was a bug!! maybe related to your inability to see spans. pushing a fix now.
Local spans have been discussed at length, but have never been formalized. This formalizes how to tag a span as local, including rationale documentation. To help demonstrate the point, zipkin-web and zipkin-query use this for bootstrap tracing.
7856fdd
to
482a6b4
Compare
rebased with a fix to a bug where the tracers weren't initializing. @yurishkuro @kristofa please take a look. I'd like to add support to this to brave, but want to make sure folks are on-board before raising that. |
last call for feedback, I'll merge in a couple hours and address anything else post-merge |
looks good |
Introduces LOCAL_COMPONENT("lc") binary annotation and example use-case
@adriancole I pulled this, but still not able to see local spans, even though I do send ts and duration. Your screenshots above show "cr" for both examples of local spans. Did you try it without having any RPC annotations on the local span? |
good point. so we have a test that shows spanstore doesn't require annotations, but maybe there's some special casing in the web process subverting this. Should be possible to reproduce by making json and then posting it to the query server. I'll have a look. |
the json result from query service does not return that local span either, so it might be deeper than web layer |
A local span can represent bootstrap, codec, file i/o or other activity that notably impacts performance. Local spans always have a binary annotation "lc" which indicates the component name. Usings zipkin's UI or Api, you can query by for spans that use a component like this: `lc=spring-boot` Here's an example of allocating precise duration for a local span: ```java tracer.startSpan("codec", "encode"); try { return codec.encode(input); } finally { tracer.finishSpan(); } ``` Fixes #111 See openzipkin/zipkin#821
brave user here: The trace_id generate for a span generated from the local tracer is different from other spans for the same trace. may be that's the problem here? |
@nishantshobhit feel free to hop on openzipkin/zipkin even if the questions are about brave. I have a working example of local tracer in the zipkin-java project. However, there's some important details about the implementation of span storage in brave you need to keep in mind. Look here for details: https://github.com/openzipkin/brave/blob/master/brave-core/src/main/java/com/github/kristofa/brave/LocalSpanState.java#L9 |
A local span can represent bootstrap, codec, file i/o or other activity that notably impacts performance. Local spans always have a binary annotation "lc" which indicates the component name. Usings zipkin's UI or Api, you can query by for spans that use a component like this: `lc=spring-boot` Here's an example of allocating precise duration for a local span: ```java tracer.startSpan("codec", "encode"); try { return codec.encode(input); } finally { tracer.finishSpan(); } ``` Fixes #111 See openzipkin/zipkin#821
Local spans have been discussed at length, but have never been
formalized. This formalizes how to tag a span as local, including
rationale documentation. To help demonstrate the point, zipkin-web and
zipkin-query use this for bootstrap tracing.
Fixes #808
Here are example local spans from finatra and twitter-server bootstrap: