pierrejeambrun commented on code in PR #46177:
URL: https://github.com/apache/airflow/pull/46177#discussion_r1934112082
##########
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:
We can't do that. We cannot copy past that code using manual regexp on
different endpoints trying to strip path parameters to shorten the generated
event name. At this stage we can either:
- Do a db migration to allow more than 60 char in the database for the event
name
- Find a better `name` generation process that will generate shorter names
--
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]