You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vatsrahul1001 (via GitHub)" <gi...@apache.org> on 2025/02/05 18:16:04 UTC
Re: [PR] AIP84- Log user actions for DAGRUN endpoints [airflow]
vatsrahul1001 commented on code in PR #46177:
URL: https://github.com/apache/airflow/pull/46177#discussion_r1943445822
##########
airflow/api_fastapi/logging/decorators.py:
##########
@@ -79,11 +80,12 @@ async def log_action(
user: Annotated[BaseUser, Depends(get_user_with_exception_handling)],
):
"""Log user actions."""
- request_body = await request.json()
- masked_body_json = {k: secrets_masker.redact(v, k) for k, v in request_body.items()}
-
- event_name = event or request.url.path
+ # This is needed as size of event column in log table is varchar60 and run_id is already getting stored
+ # in run_id column so we can remove from url.
+ pattern = r"(/scheduled__|/manual__)\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}"
+ request_url = re2.sub(pattern, "", request.url.path)
Review Comment:
`request.scope["endpoint"].__name__` works for endpoint name I have implemented this
--
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-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org