Skip to content
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

Brave/Sleuth example? #5

Open
codefromthecrypt opened this issue Oct 1, 2019 · 13 comments
Open

Brave/Sleuth example? #5

codefromthecrypt opened this issue Oct 1, 2019 · 13 comments

Comments

@codefromthecrypt
Copy link

We had a request for request/response tagging on sleuth channel. If/when things integrate around that it would be nice to have an example here, or a branch off https://github.com/openzipkin/sleuth-webmvc-example

cc @marcingrzejszczak

@codefromthecrypt
Copy link
Author

@AndersClausen was also looking for this in order to store container bookings for shipping logistics

@mchandramouli
Copy link

@adriancole will look into integrating with zipkin spans later this month. I will work with @ashishagg and Vaibhav to wire it to the agent. Will update this issue.

@AndersClausen
Copy link

@mchandramouli I'm wondering if there's an update on your comment above, as I'm really keen to see what you've come up with.

@AndersClausen
Copy link

Hi @ashishagg Any chance you could give me an update on your progress on the comments above? Many thanks

@ashishagg
Copy link
Collaborator

@mchandramouli has added zipkin-blob support in blobs core repo.

I have just committed my changes in haystack-dropwizard library that provides easy integration of traces and blob(req/resp) feature. This may give you a clue of how we are thinking to integrate.

Also check the latest code in this example, it now needs a blobs config change to enable the req/resp logging and add a span tag for the dereferencing.

I will now work on haystack spring library to enable the similar functionality. I will share those changes and then work on zipkin example.

@ashishagg
Copy link
Collaborator

It seems the similar approach will work to integrate blobs with opentracing-spring-web-starter
ServletFilterSpanDecorator and RestTemplateSpanDecorator implementation will do the trick.

@adriancole For brave, does the tracing library provide any decorator pattern? I can implement one provide a library for spring integration

@codefromthecrypt
Copy link
Author

there are things like HttpClientParser which add things into the span. the problem with blobs is that I think it would need to change the request itself in some cases, right?

@ashishagg
Copy link
Collaborator

Intent of blobs to capture the request and response in its original form, push it to distributed file system through haystack-agent(or some other forwarders).
At the same time, a tag is added with a blob-uri that helps us to refer both req/resp on the UI.

I have made changes that does all heavy lifting to integrate blobs and works with opentracing-spring-web-starter.

https://github.com/ExpediaDotCom/opentracing-spring-haystack-starter/pull/14/files

Will update README and example to show how just a config update turns on this feature.

@ashishagg
Copy link
Collaborator

fyi. The blob integration is completed for opentracing-spring-haystack library.

@adriancole , for sleuth/brave integration, FinishedSpanHandler looks the closest match for adding tags in a span.
In short, this is what we have done for haystack-spring integration:
a) Servlet Filter that captures request/response in its raw form(byte[]). It adds them as attributes in HttpRequest object.
b) Add a SpanDecorator(similar to FinishedSpanHandler) that gets blobs(via httpRequest#getAttribute), dispatches them and also add a span-tag pointing to blob location.

My question on 'FinishedSpanHandler' - since it doesn't pass HttpRequest in handler call, but it sends TraceContext that has called List<Object> extras. Can we add req/resp blob in this extras ?

@codefromthecrypt
Copy link
Author

http parser is probably closer to the mark as you can access the raw type. For example, if nothing is sampled, surely we shouldn't add overhead of converting to byte arrays right?

https://github.com/openzipkin/brave/tree/master/instrumentation/http#span-data-policy

otoh our current parser is a single object where finished span handler can have multiple.. it could make sense when refactoring to allow multiple parsers. I'll tee that off here.. openzipkin/brave#999

@codefromthecrypt
Copy link
Author

openzipkin/brave#1069

@ashishagg
Copy link
Collaborator

I will leave this till multiple parsers come into existence. But for my knowledge, I may try an alternate implementation with FinishedSpanHandler and ServletFilter. I guess we can avoid byte[] conversions in case of non-sampling.

@codefromthecrypt
Copy link
Author

codefromthecrypt commented Jan 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants