Fix Workflow level OTLP tracing with Python workers

By default in the Python SDK, unlike the Java SDK, we do not emit spans for workflows if the client was not started with a span. The client span would be StartWorkflow and it is not emitted if the workflow was started from CLI, schedule, or client without that interceptor. We do this because there is a risk of orphaned spans on replay (because there is no stable span created client side to be the overarching parent).

As part of this PR, we added an option to that interceptor called always_create_workflow_spans that you can set to True to override this behavior and always create spans workflow side even if there is not one client side. This was released as part of v1.11.0 last week.

1 Like