airflow
airflow copied to clipboard
Audit rest api update requests
Description
Need a way to monitor updates from rest api, like persisting requests into existing log table.
Use case/motivation
Airflow UI audit user actions by logging into log table, but this feature is missing in the rest api endpoints. For production this feature is needed to track mis usages or bugs.
Related issues
No response
Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Discussion on the devlist here: https://lists.apache.org/thread/4n5on5srh0lnlwjy92p3m00dch52o35h I think it's a nice idea and hope someone will pick it up.
airflow.www.decorators has action_logging method used in different parts of the views for logging. An example of using the decorator in the patch_connection endpoint where I modified the description of the connection using rest api.
| Id | Dttm | Dag Id | Task Id | Event | Logical Date | Owner | Extra |
|---|---|---|---|---|---|---|---|
| 2581 | 2022-04-23, 11:56:53 | None | patch_connection | test | [('connection_id', 'aws_default')] |