souradeep07 opened a new pull request, #75100:
URL: https://github.com/apache/airflow/pull/75100

   Tracebacks in task logs show each frame's file, line number and function, 
but not the line of code that was running, unlike Airflow 2 or a plain Python 
traceback.
   
   Task logs are always written as JSON, and structlog's 
`ExceptionDictTransformer` doesn't record source code for frames. This adds 
each frame's source line (via `linecache`, as the stdlib `traceback` module 
does) and shows it under the frame in the UI log view and in downloaded/copied 
logs.
   
   closes: #55910
   
   #### Before
   <img width="1186" height="271" alt="before" 
src="https://github.com/user-attachments/assets/37f9ebbd-d6dd-4bec-ab64-ac12908d3aaa";
 />
   
   #### After
   <img width="1186" height="523" alt="after" 
src="https://github.com/user-attachments/assets/6cf36de9-6301-4f45-a4ec-d5a90a18e828";
 />
   
   
   
   #### Performance
   
   JSON logging, median of 7 runs:
   
   | | Before | After |
   | --- | --- | --- |
   | Plain log line (unaffected) | 6.97 µs | 7.05 µs |
   | Exception with a 14-frame traceback | 80 µs | 111 µs |
   
   The extra cost is only paid when an exception is logged.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to