temporalio / sdk-typescript

Temporal TypeScript SDK
Other
531 stars 104 forks source link

[Feature Request] Add built-in support for context propagators #998

Open bergundy opened 1 year ago

bergundy commented 1 year ago

Currently we recommend implementing those with interceptors but seems like there's enough demand for a simpler context propagation specific API (see Java and Go SDKs for reference).

Internally we may choose to implement context propagation with interceptors or expose a context propagation interceptor for users.

cretz commented 1 year ago

If this gets implemented before Python or .NET, can we make it experimental until one other SDK gets it? I think it's worth seeing how it could be best done in a modern way in multiple languages.

Prashansa-K commented 1 year ago

@bergundy @cretz Is there any ETA for this? I am using interceptors right now. When a request comes to my service (which does a bunch of ops before starting a temporal workflow) that starts a temporal workflow it leads to one trace (trace A) and another trace comes from the entire workflow execution (trace B). How can I connect these two traces? I tried the context propagation method in this doc but that doesn't work. https://docs.temporal.io/application-development/observability?lang=typescript#tracing Is there any other way to achieve a complete trace? Is there any working example that can be followed for the same?

When this feature request is done and a context propagator is provided, will it be possible to connect the traces? I see that the golang SDK already provides this option via ClientOptions.

bergundy commented 1 year ago

I'll prioritize, no ETA at the moment.