Add analytics logging

This commit is contained in:
Ori Kotek
2024-02-26 16:15:23 +02:00
parent 64feef585a
commit 8843f7bc8b
3 changed files with 9 additions and 2 deletions

View File

@ -205,8 +205,9 @@ async def handle_request(body: Dict[str, Any], event: str):
return {}
agent = PRAgent()
sender = body.get("sender", {}).get("login")
app_name = get_settings().get("CONFIG.APP_NAME", "Unknown")
log_context = {"action": action, "event": event, "sender": sender, "server_type": "github_app",
"request_id": uuid.uuid4().hex}
"request_id": uuid.uuid4().hex, "app_name": app_name}
# handle comments on PRs
if action == 'created':