[Feature Request] Loss of stack trace information

Abierto
#807 3 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Comienza en temporalio/converter.py, alrededor de las líneas 826-829, donde se copia el fallo, y reproduce el problema con los puntos de entrada TestParentWorkflow, TestChildWorkflow y test_activity. Sigue cómo se mueve el stack_trace del Failure Protobuf a través de la cadena ActivityError y ChildWorkflowError. La tarea estará terminada cuando Sentry pueda acceder a la información del stack trace de cada error de la cadena sin perder el trace original de la actividad.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
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 both ActivityError and ApplicationError are missing it.
  • I understand the exceptions are passed through the distributed system using the Failure Protobuf message which has a stack_trace field which could be used to populate the Sentry stack trace. This works for getting the stack trace of the ApplicationError in the activity. However, it's impossible to get the stack trace for the ActivityError in the TestChildWorkflow because the failure is just copied from the original failure here: https://github.com/temporalio/sdk-python/blob/bf747f1170e603b1e1adbd77c673fa83f0c99e7d/temporalio/converter.py#L826-L829
Image

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.
Lenguaje dominante
Python
Estrellas
1.2k
Forks
241
Merge medio
3 d 2 h
PR fusionados (30 d)
49

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de temporalio/sdk-python

Todos los issues de temporalio/sdk-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.