cadence-client icon indicating copy to clipboard operation
cadence-client copied to clipboard

Trace spans for concrete workflow executions are not created

Open simoneeconomo opened this issue 4 years ago • 0 comments

Currently, the Go client doesn't create OpenTracing spans when a workflow is executed by a worker. It only does so right after a workflow is invoked from a client through StartWorkflow or SignalWithStartWorkflow requests, but the span is immediately closed.

The ability to trace the concrete execution of a workflow "worker-side" would be useful to get better waterfalls in trace visualization products (e.g., Kibana). For example, in the image below a "master" workflow is invoked by a REST API client. Once the master workflow is executed, it spawns a child workflow which, in turn, executes some activities (using cadence-client v0.11.2). However, in the image, it's not immediately clear that two workflows are being executed (it can be deduced, but it would be better to just see the actual spans).

kibana-waterwall

As far as I can see in the code, this features seems to be in someones's todo list. I was wondering whether there is still any plan to include such a feature in the Go client. If not, is there any alternative way to achieve that? Perhaps a custom tracing context propagator would do, but I fear it means disabling the client internal tracer and re-inventing parts of the wheel.

Also, I was wondering whether it makes sense to provide access to the active SpanContext in a workflow or activity Context, as a way to support the creation of custom child spans. As far as I know, currently it is not possible because the context key that is used to store it is private to the Go client. Is it by design? If so, why?

Thank you.

simoneeconomo avatar Jul 10 '20 16:07 simoneeconomo