uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.

Home Page:https://cadenceworkflow.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trace spans for concrete workflow executions are not created

simoneeconomo opened this issue · 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.