-
Notifications
You must be signed in to change notification settings - Fork 34
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
Working XRayUDPReporter and STORAGE_TYPE xray #56
Conversation
@adriancole Any time to merge this and cut a release? :) We are eager to test it with brave. |
this needs some work first, and I don't want to release it until openzipkin/brave#514 is in.. likely early next week depending on feedback. |
Brave 4.9 is going out now, which I've tested this with, but obviously this code needs polish and unit tests etc. I'll work on that tomorrow and meanwhile the impatient can copy/paste their class into their project. Here's the docs on the propagation part: https://github.com/openzipkin/brave/tree/master/propagation/aws#brave-propagation-aws |
@adriancole I am in the process integrating. I was building Xray branch and the only minor issue I have seen so far is that
Animal Sniffer is complaining about this which after 1.6. It might be experimental codes? I changed I will let you now for further information. |
@adriancole are you using |
1426d55
to
948d84e
Compare
This adds `XRayUDPReporter` which defaults to localhost:2000 or AWS_XRAY_DAEMON_ADDRESS. This can be used in applications directly or integrated with a zipkin-server where `STORAGE_TYPE=xray` Note: this is experimental and makes assumptions about trace ID format: See openzipkin/b3-propagation#6
948d84e
to
3e1b56d
Compare
OK I have this working, tested with AWS Lambda and outside as well. Ex: here's an AWS lambda decorator: package zipkin.lambda;
import brave.Span;
import brave.Tracer;
import brave.Tracing;
import brave.propagation.aws.AWSPropagation;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import zipkin2.reporter.xray_udp.XRayUDPReporter;
public abstract class TracingRequestHandler<I, O> implements RequestHandler<I, O> {
final Tracer tracer;
protected abstract RequestHandler<I, O> delegate();
TracingRequestHandler(Tracing.Builder builder) {
this.tracer = builder
.propagationFactory(AWSPropagation.FACTORY)
.spanReporter(XRayUDPReporter.create()).build().tracer();
}
@Override
public O handleRequest(I input, Context context) {
/** Always start lambda functions from the root in the env */
Span span = tracer.nextSpan(AWSPropagation.extractLambda())
.name(context.getFunctionName())
.start();
try (Tracer.SpanInScope ws = tracer.withSpanInScope(span)) { // so logging can see trace ID
return delegate().handleRequest(input, context); // do the actual work
} catch (RuntimeException | Error e) {
String message = e.getMessage();
if (message == null) message = e.getClass().getSimpleName();
span.tag("error", message); // make sure any error gets into the span before it is finished
throw e;
} finally {
span.finish(); // ensure the span representing this processing completes.
}
}
} Here's spring XML config:
I also assembled a server and set |
going to merge and cut a release so folks can try it. tests obviously need backfilling and help appreciated with that |
I tested with new release. It is working. 👍 Thanks for your efforts. This will be a really huge milestone for many people. Now I will start to integrate into our applications which are running on Kubernetes. I will let you know details. |
Thanks for your dilligence! Note I just release the docker integration in
the docker-zipkin-aws repo if it helps.
Please do keep us posted what you do with these things :)
…On 17 Oct 2017 15:40, "Cemalettin Koc" ***@***.***> wrote:
I tested with new release. It is working. 👍 Thanks for your efforts.
This will be a really huge milestone for many people.
Now I will start to integrate into our applications which are running on
Kubernetes. I will let you know details.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#56 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD619jgI58gBV5aBlIjmNROMzNcSawlks5stFoDgaJpZM4P1m2T>
.
|
from openzipkin/brave#510
This adds
XRayUDPReporter
which defaults to localhost:2000 orAWS_XRAY_DAEMON_ADDRESS. This can be used in applications directly or
integrated with a zipkin-server where
STORAGE_TYPE=xray
Note: this is experimental and makes assumptions about trace ID format:
See openzipkin/b3-propagation#6