Propagate opentelemetry spans across remote connections.#74
Propagate opentelemetry spans across remote connections.#74rread wants to merge 1 commit inton0-computer:mainfrom
Conversation
There was a problem hiding this comment.
Thanks! The feature sounds useful.
-
With this PR the wire format of a protocol changes based on feature flags for
irpc. We can't do this unfortunately: You would never want your wire messages to change because some dependency enabled a feature onirpcwhich will - due to feature unification - affect all crates in the workspace dependency tree. So, we need a different approach here. I'll have to do some thinking how best to do this. -
The PR makes the code generation dependant on feature flags on the proc macro crate. I think this is a no-go: Due to feature unification you can never know for sure if and where a feature got enabled. So this should be based on configuration via attributes on the
rpc_requestsmacro instead. -
The opentelemetry integration should be behind a separate feature
use-tracing-opentelemetryor similar
|
Thanks for your review. I updated this to make OpenTelemetry span propagation opt-in per service instead of being globally enabled via feature flags. Changes
|
a13164a to
dcc2dd5
Compare
Adds a new `rpc_request` feature `span_propagation` and a newcrate feature `use-tracing-opentelemetry`.When enalbed, the current span context is extracted and serialized with the message,and deserialized in `read_request_raw()` and saved in thread localstorage. The generated `RemoteService` creates a new span based onthe message variant name, and sets the new span's parent to theextracted context.
|
Fixed the CI errors. |
|
Any chance this can make the next release? I'd like to use this to get distributed traces of my app |
The current span context is extracted and serialized with the message, and deserialized in read_request_raw() and saved in thread local storage. The generated RemoteService now creates a new span based on the message variant name, and sets the new span's parent to the extracted context.
Fixes #71