airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Fix rest API logging

Open bbovenzi opened this issue 1 year ago • 1 comments

Part of https://github.com/apache/airflow/issues/22352

Try to improve action logging in the REST API. Include api.{name_of_function}. We should probably try to capture more information for extra but audit log now reads like so:

Screenshot 2024-02-20 at 11 15 15 PM

This is a draft to get feedback on the format and then I will do it for basically all PATCH, PUT, POST, DELETE endpoints


^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

bbovenzi avatar Feb 21 '24 04:02 bbovenzi

LGTM

vincbeck avatar Feb 21 '24 15:02 vincbeck

Made extra a json object instead of a tuple. Added request body to extra. And hiding sensitive fields for connections and variables:

Screenshot 2024-02-21 at 9 49 41 PM

bbovenzi avatar Feb 22 '24 02:02 bbovenzi

Looks good for me!

jscheffl avatar Feb 24 '24 19:02 jscheffl

Closing in favor of https://github.com/apache/airflow/pull/37734

I want to leave changes to variables+connections API and the extra field as a separate effort

bbovenzi avatar Feb 27 '24 03:02 bbovenzi