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

Tracing AMQP Workflow #28

Closed
Mulkave opened this issue Nov 5, 2018 · 3 comments

Comments

@Mulkave
Copy link

commented Nov 5, 2018

For a workflow as follows:

Start (Service A) -- amqp --> General Processing (Service B) ---
--- amqp --> Fork into two queues Task C (Service C) and D (Service D)

The exact similar case of jaegertracing/jaeger-client-python#122

From the code examples:

$tracer = $config->initTrace('Service A', '0.0.0.0:6831');
$spanContext = $tracer->extract(Formats\TEXT_MAP, $_SERVER);

$serverSpan = $tracer->startSpan('get data', ['child_of' => $spanContext]);
$serverSpan->addBaggageItem("version", "1.6.0");

$tracer->inject($serverSpan->getContext(), Formats\TEXT_MAP, $_SERVER);

Questions

  1. what does extract(Formats\TEXT_MAP, $_SERVER) achieve?
  2. Is it the server's spanContext that needs to be shared across all services and have them bi child_of of it?
  3. How would you recommend to share a trace that goes from Service A to Service D to cover the mentioned workflow?

Much appreciated!

@jukylin

This comment has been minimized.

Copy link
Owner

commented Nov 6, 2018

Does amqp implement Distributed Tracing?

@Mulkave

This comment has been minimized.

Copy link
Author

commented Nov 6, 2018

Not with PHP, no. There is a Go package for that though https://github.com/opentracing-contrib/go-amqp not sure if it helps (new to this realm, sorry).

On the other hand, it is not necessary to track within AMQP, what matters is to trace the spans in the services (it's alright to skip AMQP for tracing).

Would that work? i.e. if we were to pass the SpanContext through message headers of AMQP somehow?

@jukylin

This comment has been minimized.

Copy link
Owner

commented Nov 6, 2018

I think you need to inject SpanContext to message body. Like this: Service A: $tracer->inject($serverSpan->getContext(), Formats\TEXT_MAP, $amqpMsg) and Service C : $tracer->extract(Formats\TEXT_MAP, $amqpMsg)

@jukylin jukylin closed this Nov 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.