PR for Add Logging and Monitoring for PDF Generation#53
Open
clintjeff2 wants to merge 42 commits intoDistinctCodes:mainfrom
Open
PR for Add Logging and Monitoring for PDF Generation#53clintjeff2 wants to merge 42 commits intoDistinctCodes:mainfrom
clintjeff2 wants to merge 42 commits intoDistinctCodes:mainfrom
Conversation
- Add PdfGenerationLog model with comprehensive tracking fields - Add PdfInputType enum for HTML/MARKDOWN distinction - Include metadata fields: input size, processing time, success status - Add error logging fields: error message and stack trace - Include request tracing: user agent, IP address, request ID - Add performance indexes for efficient querying - Establish foreign key relationship with User model
- Create PdfLogService for database logging operations - Add detailed PDF generation request logging with metadata - Implement user analytics with success rates and performance metrics - Add system-wide analytics for administrative monitoring - Include error pattern analysis for debugging support - Provide safe input snippet creation with sensitive data removal - Add request tracing and performance monitoring capabilities
- Add detailed request logging with unique request IDs - Implement safe input snippet creation for debugging - Add comprehensive error logging with stack traces - Include request metadata tracking (user agent, IP address) - Add new analytics endpoints for users and administrators - Implement processing time measurement and performance logging - Add error pattern analysis endpoint for system monitoring
- Add PdfLogService to PDF module providers - Import PrismaModule for database access - Export PdfLogService for potential use in other modules - Update module dependencies for logging functionality
Contributor
Author
|
Hello @yusuftomilola, please review and merge. Opened this over 5 days ago. |
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.
Add Logging and Monitoring for PDF Generation
Closes #18
Overview
Implements comprehensive logging and monitoring system to track PDF generation API usage, performance, and errors as requested in issue #18.
Changes Made
Database Schema
PdfGenerationLogmodel to store detailed request metadataPdfInputTypeenum for HTML/Markdown input trackingNew Services
PdfLogService- Centralized logging service with analytics capabilitiesAnalytics & Monitoring
Enhanced PDF Controller
GET /pdf/analytics- User's PDF generation analyticsGET /pdf/analytics/system- System-wide analytics (admin)GET /pdf/analytics/errors- Error pattern analysisLogged Metadata (Per Issue Requirements)
Additional Features
API Examples
User Analytics
System Analytics (Admin)
Error Patterns
Database Migration Required
npx prisma db push # or npx prisma migrate dev --name add-pdf-loggingDependencies Added
uuid- For request ID generation@types/uuid- TypeScript typesTesting
Performance Impact