sjyangkevin commented on issue #58381:
URL: https://github.com/apache/airflow/issues/58381#issuecomment-3731837378

   Hi @pluto0007 ,
   
   I attempted to re-produce the issue but I would like to confirm if it exact 
the same as what you get.
   
   ### Airflow 2 Test
   Run airflow using breeze with the following command to observe the audit 
logs:
   ```bash
   breeze start-airflow --python 3.12 --backend postgres --use-airflow-version 
2.11.0 --db-reset
   ```
   As you mentioned, the task lifecycle state transition (queued, running, 
success, failed) is logged.
   
   <img width="1603" height="600" alt="Image" 
src="https://github.com/user-attachments/assets/e47de9b3-78f7-418b-9860-54b11bf45281";
 />
   
   <img width="1290" height="507" alt="Image" 
src="https://github.com/user-attachments/assets/dc4412f1-baef-4e6f-88e8-11159b18b418";
 />
   
   ### Airflow 3 Test
   Run Airflow 3.1.5 with
   ```bash
   breeze start-airflow --python 3.12 --backend postgres --use-airflow-version 
3.1.5 --auth-manager FabAuthManager --db-reset --mount-sources 
providers-and-tests
   ```
   The same DAG that I used in Airflow 2 is ran, but I only observed user 
action, as shown below.
   
   I triggered the DAG and it resulted two events 1.) unpause through PATCH, 
2.) trigger through POST. However, I cannot see any task lifecycle state 
transition being logged. You mentioned:
   
   >failed and state mismatch are logged
   
   I wonder if there is additional setting I should add to it, or if my set up 
result in some issues that these states are not logged.
   
   <img width="1599" height="768" alt="Image" 
src="https://github.com/user-attachments/assets/7d9fe981-fd8a-48e6-8a43-74559865c9a4";
 />
   
   <img width="1290" height="387" alt="Image" 
src="https://github.com/user-attachments/assets/08e9c349-3cb6-47cc-94ea-eb687e87c7a1";
 />
   
   I did some research over the issues and PRs and find the followings:
   
   1. https://github.com/apache/airflow/issues/44057
   2. https://github.com/apache/airflow/pull/45609
   3. https://github.com/apache/airflow/pull/54767
   
   From my understanding, it looks like these user actions are logged through 
the `action_logging`. I wonder if now the `log` table only tracks for user 
interactions. As mentioned in the 
[document](https://airflow.apache.org/docs/apache-airflow/stable/security/audit_logs.html#scope-of-audit-logging),
 system generated events include task lifecycle state transition should be in 
the scope of audit log.
   
   
https://github.com/apache/airflow/blob/8d28fe848da385634eeffc9865e85d15bd1882e8/airflow-core/src/airflow/api_fastapi/logging/decorators.py#L77
   
   I would like to also check if I am on the right track, and would appreciate 
if anyone with more experience in this area could provide some insights. Please 
correct me if my set up is wrong. Thanks!


-- 
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