feat: add upload analytics API with key metrics and usage insights#102
Open
Krushna-Pisal wants to merge 4 commits into
Open
feat: add upload analytics API with key metrics and usage insights#102Krushna-Pisal wants to merge 4 commits into
Krushna-Pisal wants to merge 4 commits into
Conversation
Adds structured task states, metadata tracking, and improved error handling for Celery upload tasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new analytics endpoint to provide useful insights into the upload system. It helps in understanding usage patterns, tracking performance, and identifying failures more easily.
###What is Added
A new endpoint:
GET
/api/upload/statsThis endpoint returns key metrics such as:
###Additional Insights
To make the API more useful for monitoring and future UI integration, the following are also included:
###Implementation Notes
Sample Response
{ "status": "success", "data": { "total_uploads": 250, "successful_uploads": 210, "failed_uploads": 40, "success_rate": 84.0, "average_upload_time": 3.1, "uploads_last_24h": 22, "status_distribution": { "success": 210, "failed": 40, "processing": 5 }, "file_type_distribution": { "jpg": 80, "pdf": 60 }, "daily_upload_trend": [ {"date": "2026-04-20", "count": 10}, {"date": "2026-04-21", "count": 15} ] } }🚀 Why This Matters
This adds basic observability to the upload system and can be useful for:
Future Improvements