Update task task-81
This commit is contained in:
@@ -31,3 +31,18 @@ Create a comprehensive logging system to track all Telegram bot interactions, in
|
||||
- [ ] Bot integration automatically logs all requests
|
||||
- [ ] Performance impact of logging is minimal
|
||||
- [ ] Data retention and cleanup policies are implemented
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
1. Design and create TelegramBotLog model with fields for telegram_user_id, telegram_username, telegram_first_name, telegram_last_name, request_timestamp, fingerprint_computation_time, search_computation_time, search_results_count, response_data (JSON), and associations to BlobFile for processed images
|
||||
2. Create database migration for telegram_bot_logs table with proper indexes for performance (telegram_user_id, request_timestamp, search_results_count)
|
||||
3. Set up BlobFile association in TelegramBotLog model to store the processed image files
|
||||
4. Create TelegramBotLogsController with admin-only authorization (similar to GlobalStatesController pattern)
|
||||
5. Implement index action with filtering and pagination (by user, date range, performance metrics)
|
||||
6. Create view templates for listing and viewing individual audit logs with search and filter functionality
|
||||
7. Add logging integration to TelegramBotTask - instrument fingerprint computation time and search time
|
||||
8. Update TelegramBotTask to save processed images as BlobFiles and create audit log records for each request
|
||||
9. Add data cleanup/retention policy (e.g., delete logs older than 6 months, configurable via GlobalState)
|
||||
10. Add routes for admin audit interface following existing patterns
|
||||
11. Style views consistently with existing admin interfaces
|
||||
12. Test integration end-to-end with bot interactions and verify minimal performance impact
|
||||
|
||||
Reference in New Issue
Block a user