-
Notifications
You must be signed in to change notification settings - Fork 719
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
AWS Propagation support #510
Conversation
a362e81
to
140a92e
Compare
Added extract impl, tests and benchmarks. Parsing within a header value is more expensive than separate headers. I got it as quick as I could within a reasonable amount of time. |
Note: there's a behavior difference in X-Ray vs B3, which is that you can send only a trace ID (not a span ID). This implied a separate commit, which I can pull out separately later. This commit makes it possible to get just the trace ID (which is specified by ELB for log correlation purposes, and has no span ID as ELB doesn't write to X-Ray). |
} | ||
|
||
TraceContext nextContext(@Nullable TraceContext parent, SamplingFlags samplingFlags) { | ||
TraceContext nextContext( |
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.
Since the actual precedence is TraceContext
and then TraceIdContext
, what about reflecting this in the signature?
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.
good idea. done
@adriancole this is the best thing, I have ever seen for a while. do you have any idea about when this support will be ready for testing? |
Awesome work @adriancole |
140a92e
to
7c86da2
Compare
added end-to-end overhead benchmarks, which show the overhead related to this isn't statistically significant in the big picture. @cemo glad you like! trying to get a converting reporter working today. After that, will need to step back and make sure tech debt isn't added, but won't be long. watch this thread |
645bfbf
to
46ef389
Compare
7c86da2
to
6b0650a
Compare
so far so good. Propagation works (creating single-host spans). The trace ID prefix of 59d5a836 is legit (1507174454 in epoch seconds, which is right) Here's a diff for the https://github.com/openzipkin/brave-webmvc-example changed to use this so far index 3e0967a..0ccec3b 100755
--- a/servlet3/pom.xml
+++ b/servlet3/pom.xml
@@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <brave.version>4.8.1</brave.version>
+ <brave.version>4.8.2-SNAPSHOT</brave.version>
<zipkin-reporter2.version>2.0.2</zipkin-reporter2.version>
<spring.version>4.3.8.RELEASE</spring.version>
<log4j.version>2.8.2</log4j.version>
diff --git a/servlet3/src/main/java/brave/webmvc/TracingConfiguration.java b/servlet3/src/main/java/brave/webmvc/TracingConfiguration.java
index dd1f7e4..465501b 100644
--- a/servlet3/src/main/java/brave/webmvc/TracingConfiguration.java
+++ b/servlet3/src/main/java/brave/webmvc/TracingConfiguration.java
@@ -3,6 +3,7 @@ package brave.webmvc;
import brave.Tracing;
import brave.context.log4j2.ThreadContextCurrentTraceContext;
import brave.http.HttpTracing;
+import brave.propagation.XRayPropagation;
import brave.spring.web.TracingClientHttpRequestInterceptor;
import brave.spring.webmvc.TracingHandlerInterceptor;
import java.util.ArrayList;
@@ -44,6 +45,8 @@ public class TracingConfiguration extends WebMvcConfigurerAdapter {
@Bean Tracing tracing() {
return Tracing.newBuilder()
.localServiceName("brave-webmvc-example")
+ .traceId128Bit(true)
+ .propagationFactory(new XRayPropagation.Factory())
.currentTraceContext(ThreadContextCurrentTraceContext.create()) // puts trace IDs into logs
.spanReporter(spanReporter()).build();
} |
6b0650a
to
a509897
Compare
a509897
to
34982a6
Compare
🕺 |
last experiments before moving this code to zipkin-aws repo:
in zipkin-aws repo, I think we'll end up with a converter, collector and a reporter component similar to what we have for stackdriver. the zipkin-aws repo contains stock zipkin components which will work on anything like brave, sleuth, wingtips etc. Trace ID propagation is beyond X-Ray (ex multiple AWS services use the same format), and the implementation is brave-specific (brave's propagation api is currently only for brave), so I think the AWSPropagation class might stay here even if in a different module |
37027eb
to
5988343
Compare
34982a6
to
981239f
Compare
5988343
to
b50316b
Compare
981239f
to
6574a8b
Compare
d840378
to
1fb6c31
Compare
6574a8b
to
9ba6f09
Compare
1fb6c31
to
981257d
Compare
9ba6f09
to
c29a5c3
Compare
Thats awesome. Great work Adrian!! Hopefully this can be a fallback for us
when people decide we shouldn't be hosting zipkin ourselves... SaaS all the
things..
…On Fri, Oct 6, 2017 at 6:47 AM, Adrian Cole ***@***.***> wrote:
Below is reporting within a brave tracer in lambda, with a custom zipkin
reporter:
[image: screen shot 2017-10-06 at 6 42 22 pm]
<https://user-images.githubusercontent.com/64215/31274713-bd32d706-aac6-11e7-898f-256db3e64c8c.png>
Next step is cleaning up stuff, including readable demo code, and code
move to zipkin-aws repo.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#510 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIiosyo_k5_HL7zQWqEStvSerrHlvuyks5spgVUgaJpZM4PtGGt>
.
|
c29a5c3
to
41d7df9
Compare
68eee86
to
586825a
Compare
Renamed to Amazon and made a utility to extract env. Checking, but I think amazon is the right name as the header format is also used by non-xray products. |
586825a
to
17379b3
Compare
This code is ready to go. The other part will be in zipkin-aws repo (the XRayUDPSender). Once that's released you will be able to make a brave app. I'm not releasing this as there's currently various problems across travis and maven central. Will try tomorrow. |
here's a place the reporter will go openzipkin/zipkin-aws#56 |
release won't happen until #514 is in, as that supports the extra fields needed in AWS (plus removes a yet-unreleased api for a better one) |
17379b3
to
f8aab23
Compare
OK the implementation no longer drops "extra" fields (besides the Self references which should be dropped). Later implementations can expose means to access these, but in the mean time we can release. Will merge and release tomorrow morning unless I hear screams. |
Lgtm |
f8aab23
to
6e3f334
Compare
with this pull request we have rewritten the whole Sleuth internals to use Brave. That way we can leverage all the functionalities & instrumentations that Brave already has (https://github.com/openzipkin/brave/tree/master/instrumentation). Migration guide is available here: https://github.com/spring-cloud/spring-cloud-sleuth/wiki/Spring-Cloud-Sleuth-2.0-Migration-Guide fixes #711 - Brave instrumentation fixes #92 - we move to Brave's Sampler fixes #143 - Brave is capable of passing context fixes #255 - we've moved away from Zipkin Stream server fixes #305 - Brave has GRPC instrumentation (https://github.com/openzipkin/brave/tree/master/instrumentation/grpc) fixes #459 - Brave (openzipkin/brave#510) & Zipkin (openzipkin/zipkin#1754) will deal with the AWS XRay instrumentation fixes #577 - Messaging instrumentation has been rewritten
Starting with trace ID propagation and ad-hoc reporting:
Below is reporting within a brave tracer in lambda, with a custom zipkin reporter:
Next step is cleaning up stuff, including readable demo code, and code move to zipkin-aws repo.
End to end (overhead) benchmarks (currently propagation only, not conversion)