Tweak analytics log message to add api_url

This commit is contained in:
Ori Kotek
2024-02-28 12:05:01 +02:00
parent d54c5574a1
commit 9c7ac125e1

View File

@ -213,9 +213,8 @@ def handle_closed_pr(body, event, action, log_context):
return return
api_url = pull_request.get("url", "") api_url = pull_request.get("url", "")
pr_statistics = get_git_provider()(pr_url=api_url).calc_pr_statistics(pull_request) pr_statistics = get_git_provider()(pr_url=api_url).calc_pr_statistics(pull_request)
with get_logger().contextualize(**log_context): log_context["api_url"] = api_url
with get_logger().contextualize(pr_statistics=pr_statistics): get_logger().info("PR-Agent statistics for closed PR", analytics=True, pr_statistics=pr_statistics, **log_context)
get_logger().info("PR-Agent statistics for closed PR", analytics=True)
async def handle_request(body: Dict[str, Any], event: str): async def handle_request(body: Dict[str, Any], event: str):