-
Notifications
You must be signed in to change notification settings - Fork 51
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
Allow client to support brave/zipkin distributed tracing in a non-intrusive way #69
Conversation
Thanks for the PR! I've looked the patch briefly and it looks good overall (as you correctly reflected my opinion at #57 as you mentioned :) ). One major point I'd like to discuss before start looking into the detail is the scope of tracing application. Also, some users for implements Can you consider this point? |
Makes sense. In that case we also need to propagate the context from the
The processor implementation can start its own spans, which will have the current span as a parent (since it's in context on the current thread). So I don't think we need to do anything at the decaton level here (and indeed I think we don't need to start a span around the process call either - if the processor wants this to be a separate span it can start one itself). That said I do think it makes more sense to close the span when the processresult is completed rather than when the call to push returns though. Will rework. |
Indeed. Decaton already has two concept for tracking task's processing duration - process time and complete time, as they're exposed independently in metrics. Process time corresponds to the time that the |
I can see that many users will want that kind of structure, but I think for some users two separate spans might be more complex than necessary. So I don't think we actually need to provide the "process time" span at decaton framework level - if a user wants a span that covers the execution of their |
brave/src/main/java/com/linecorp/decaton/processor/runtime/BraveTracingProvider.java
Outdated
Show resolved
Hide resolved
processor/src/it/java/com/linecorp/decaton/processor/RetryQueueingTest.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/com/linecorp/decaton/testing/KafkaAdmin.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/com/linecorp/decaton/testing/TestUtils.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/com/linecorp/decaton/testing/processor/ProcessingGuarantee.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/TracingProvider.java
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/PartitionContexts.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/SubscriptionBuilder.java
Outdated
Show resolved
Hide resolved
Yeah, that's true. At the same time one of the key benefits that a library provides is a good default that helps many users from needing to write same boilerplates. As you said, especially for sync So a good default depends on how harmful it is to have both process and complete measurements for sync type process users.
Can you explain bit more about how is it bad for users to have 2 spans? Is it about two, overlapping bars on UI? |
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorSubscription.java
Outdated
Show resolved
Hide resolved
Yes, and also increasing the storage volume (which in our case has been a significant concern). Maybe an annotation within the span would be the right way to represent this in Zipkin.
At least in the zipkin case, such a user already has to add some boilerplate to propagate the context onto that async task, so I don't think it's any more overhead for them to start a new span at the same time. I had wondered about implementing a parent class ( |
testing/src/main/java/com/linecorp/decaton/testing/processor/TestTracingProducer.java
Outdated
Show resolved
Hide resolved
Okay. Let's go with single span for process (complete) part for now. We can easily add one another if we got demands for it :) |
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 redesigning interface, look better :) just few more points.
processor/src/main/java/com/linecorp/decaton/processor/runtime/SubscriptionBuilder.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/TracingProvider.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/com/linecorp/decaton/testing/KafkaAdmin.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/com/linecorp/decaton/testing/TestUtils.java
Outdated
Show resolved
Hide resolved
brave/src/main/java/com/linecorp/decaton/processor/runtime/BraveTracingProvider.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessingContextImpl.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorSubscription.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessPipeline.java
Outdated
Show resolved
Hide resolved
brave/src/main/java/com/linecorp/decaton/processor/runtime/BraveTracingProvider.java
Outdated
Show resolved
Hide resolved
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.
added minor comment, but almost lgtm except kawamuray's points.
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorSubscription.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/ProcessingContext.java
Outdated
Show resolved
Hide resolved
brave/src/main/java/com/linecorp/decaton/processor/runtime/BraveTracingProvider.java
Show resolved
Hide resolved
brave/src/main/java/com/linecorp/decaton/processor/runtime/BraveTracingProvider.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorSubscription.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/TaskRequest.java
Outdated
Show resolved
Hide resolved
processor/src/main/java/com/linecorp/decaton/processor/runtime/TracingProvider.java
Outdated
Show resolved
Hide resolved
benchmark/src/main/java/com/linecorp/decaton/benchmark/TemporaryTopic.java
Outdated
Show resolved
Hide resolved
Except those minor points now this looks good overall to me. |
Hi, I don't understand the Travis build failure. Since I couldn't reproduce it locally I've rebased the branch to the minimum change that causes the failure. It looks like just adding the trace ID header in Many thanks, |
Ah, I see. Thanks. |
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.
LGTM
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.
LGTM 👍
Thanks for contributing a great feature!
All CI failures are caused by #56 and are not related to this patch.
Based on #50 and the discussion in #57 . Not polished - wanted to discuss whether the architecture makes sense first.
Generalise the
LoggingContext
that's returned fromProcessorContextImpl
to aTracingContext
.Allow it to be customised by a
TracingContextFactory
.Define a brave-specific implementation that reads the zipkin trace information from the Kafka record headers in a separate
brave
module.