[Feature Request] Loss of stack trace information
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- distributed-systems, observability
Research direction
Start in temporalio/converter.py around lines 826-829, where the failure is copied, and reproduce the issue with the TestParentWorkflow, TestChildWorkflow, and test_activity entry points. Trace how the Failure Protobuf stack_trace moves through the ActivityError and ChildWorkflowError chain. Done means Sentry can access stack trace information for every error in the chain without losing the original activity trace.
Written by the indexing model from the issue text.
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
ChildWorkflowErrorhas a stack trace and bothActivityErrorandApplicationErrorare missing it. - I understand the exceptions are passed through the distributed system using the
FailureProtobuf message which has astack_tracefield which could be used to populate the Sentry stack trace. This works for getting the stack trace of theApplicationErrorin the activity. However, it's impossible to get the stack trace for theActivityErrorin theTestChildWorkflowbecause the failure is just copied from the original failure here: https://github.com/temporalio/sdk-python/blob/bf747f1170e603b1e1adbd77c673fa83f0c99e7d/temporalio/converter.py#L826-L829
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.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 241
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 49
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from temporalio/sdk-python
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
temporalio/sdk-python#1517 · 10 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
temporalio/sdk-python#496 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
temporalio/sdk-python#1890 ·
-
[Bug] Local activity resolutions regrouped on replay since 1.32.0, delivering the wrong payload Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
temporalio/sdk-python#1881 · 1 comment ·
-
bug
temporalio/sdk-python#1817 · 1 comment · 1 assignee ·
All issues in temporalio/sdk-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100