bbovenzi commented on code in PR #38166:
URL: https://github.com/apache/airflow/pull/38166#discussion_r1529467730


##########
airflow/www/decorators.py:
##########
@@ -94,35 +94,54 @@ def wrapper(*args, **kwargs):
                     user = get_auth_manager().get_user_name()
                     user_display = get_auth_manager().get_user_display_name()
 
-                fields_skip_logging = {"csrf_token", "_csrf_token", 
"is_paused"}
-                extra_fields = [
-                    (k, secrets_masker.redact(v, k))
+                isAPIRequest = request.blueprint == "/api/v1"
+                hasJsonBody = request.headers.get("content-type") == 
"application/json" and request.json
+
+                fields_skip_logging = {
+                    "csrf_token",
+                    "_csrf_token",
+                    "is_paused",
+                    "dag_id",
+                    "task_id",
+                    "dag_run_id",
+                    "run_id",
+                    "execution_date",
+                }
+                extra_fields = {
+                    k: secrets_masker.redact(v, k)
                     for k, v in 
itertools.chain(request.values.items(multi=True), request.view_args.items())
                     if k not in fields_skip_logging
-                ]
+                }
                 if event and event.startswith("variable."):
-                    extra_fields = _mask_variable_fields(extra_fields)
-                if event and event.startswith("connection."):
-                    extra_fields = _mask_connection_fields(extra_fields)
+                    extra_fields = _mask_variable_fields(
+                        request.json if isAPIRequest and hasJsonBody else 
extra_fields
+                    )
+                elif event and event.startswith("connection."):
+                    extra_fields = _mask_connection_fields(
+                        request.json if isAPIRequest and hasJsonBody else 
extra_fields
+                    )
+                elif hasJsonBody:
+                    extra_fields = {**extra_fields, **request.json}

Review Comment:
   Added and with a test of `dataset_event.extra`



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to