LukeMathWalker/tracing-actix-web

Example of distributed tracing

jayvdb opened this issue · 1 comments

jayvdb commented

The README section on trace-id/distributed tracing points to the example at

https://github.com/LukeMathWalker/tracing-actix-web/tree/main/examples/opentelemetry

However that example only provides one service, and uses a very basic curl as the client.

To show that distributed tracing works, a tracing-enabled client is needed, and the test invocation needs to run client and service in separate processes to "prove" the trace is being propagated over http rather than through the global context. The example code could then automatically match the client trace-id and service parent-trace-id, turning the example into a test case.

This can also be simulated with a curl which sets the appropriate headers. This approach relies on the human proving that the trace-id appearing in the service was the same as in the curl, but it would be simpler and more suitable as an example for newbies to understand easily.

This repository is not the right place for an end-to-end tutorial on distributed tracing in Rust.

That section is meant to dissuade users from using the RequestId as a distributed correlation identifier, since better options exist in the ecosystem.

If you're looking for a tracing-aware client, my suggestion would be to look at reqwest_tracing.