dapr / rust-sdk

Dapr SDK for Rust - Alpha
Apache License 2.0
207 stars 62 forks source link

Pass grpc headers through pubsub and service invocation #175

Open ruokun-niu opened 1 month ago

ruokun-niu commented 1 month ago

Question

Hi! I have a quick question regarding how to use the Dapr Rust SDK to handle context tracing.

From my understanding, the trace context is passed through grpc-trace-bin header, although I am unsure how this can be achieved in the Rust SDK.

For pubsub, the pubsub example indicates the ability to update the metadata. Let us say that I have a grpc-trace-bin value that I want to pass to my subscriber for tracing purposes, should I configure the metadata here?

As for service invocation, the only way that I can think of is by following the grpc-proxying example, and pass in the grpc-trace-bin as a metadata to the Request. Is this the proper and only way to achieve this feature? Thanks in advance.