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

Trace Propagation in distributed enviornment #96

Open
sandeep-paliwal opened this issue May 6, 2017 · 6 comments
Open

Trace Propagation in distributed enviornment #96

sandeep-paliwal opened this issue May 6, 2017 · 6 comments

Comments

@sandeep-paliwal
Copy link

Hi,
can SpanMetadata be used to propagate span information? How to do I get traceId and span Id of parent and how can they be attached to child in different process?

@mtomas
Copy link

mtomas commented May 7, 2017

Having similar question. is it possible currently to let's say propagate paren trace information from upstream, let's say play framework down to remote akka system via available APIs ?

If not what are the places to look for in code in order to try to contribute such possibility ?

@sandeep-paliwal
Copy link
Author

I got it working in following scenario.
Akka actor(Producer) sends message to kafka.
Another Akka actor in different process(Consumer) get the message processes it and send back acknowledgment.

Key here is to use SpanMetada correctly which is returned when request is sampled. I added this to Kafka message which when received by Consumer, uses this metadata to create parent request -
trace.importMetadata(parentReq, metadata, serviceName)
Now add downstream trace request as child of this parent -
trace.createChild(child, parent)

Here trace is instance of TracingExtensionImpl provided by the akka-tracing lib.

Hope this helps you

@mtomas
Copy link

mtomas commented May 10, 2017

Thanks for sharing @sandeep-paliwal.

In my case I need to figure out how to map actor message to be tied under same trace started by Play framework when clients requests start of the operation via HTTP and stuff is delegated then to akka actor system. That means making sure that Play and Akka akka-tracing extension support play nicely together (is there any example or test spec for that @levkhomich ?).

Therefore I guess I need to somehow extract traceId, spanId and parentId, send it along with the message sent to actor system and do trace.importMetadata for the message I wanna trace further in actor code.

@levkhomich
Copy link
Owner

Sorry for late response.

@sandeep-paliwal that's exactly how it's supposed to work.

@mtomas you can use trace.exportMetadata on request: RequestHeader because akka-tracing uses request ids generated by Play and there is an implicit conversion from RequestHeader to BaseTracingSupport.

@sandeep-paliwal
Copy link
Author

@levkhomich is there a way I can check if tracing has been enabled or not? Also is it possible to programatically set sampling rate or enable/disable tracing instead of controlling it from application.conf ?

@kriloleg
Copy link

Hi!
Faced the same issue? Isn't possible to store in message id of parent too?

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