Open
Description
Is your feature request related to a problem? Please describe.
- I would like to include full stack trace information in Sentry - see screenshot below where only
ChildWorkflowError
has a stack trace and bothActivityError
andApplicationError
are missing it. - I understand the exceptions are passed through the distributed system using the
Failure
Protobuf message which has astack_trace
field which could be used to populate the Sentry stack trace. This works for getting the stack trace of theApplicationError
in the activity. However, it's impossible to get the stack trace for theActivityError
in theTestChildWorkflow
because the failure is just copied from the original failure here:sdk-python/temporalio/converter.py
Lines 826 to 829 in bf747f1

This is the workflow and activity code I'm using to test this:
@activity.defn(...)
async def test_activity() -> None:
raise TestException("Test error")
@workflow.defn
class TestChildWorkflow:
@workflow.run
async def run(self) -> None:
# execute_default_activity is our wrapper around workflow.execute_activity
await execute_default_activity(
test_activity,
retry_policy=RetryPolicy(maximum_attempts=1),
),
@workflow.defn
class TestParentWorkflow:
@workflow.run
async def run(self) -> None:
# child workflow fails parent workflow
await workflow.execute_child_workflow(
TestChildWorkflow.run,
id=f"test-child-workflow-{int(workflow.time())}",
task_queue=get_temporal_tasks_queue_name(),
)
Describe the solution you'd like
- Ability to get the stack trace for every error in the chain. I am happy to contribute this code but I am not sure if there is a strong reason for why it is done this way and whether it can be changed.