Prometheus monitoring and metrics#97
Open
gelluisaac wants to merge 4 commits intoDisciplr-Org:mainfrom
Open
Conversation
Contributor
Author
|
@1nonlypiece PR ready |
Contributor
Author
|
@1nonlypiece conflicts resolved |
Contributor
Author
|
@1nonlypiece Conflict resolved |
Contributor
Author
|
@1nonlypiece |
Contributor
|
@gelluisaac Can you resolve the conflicts? |
- Resolved conflicts by keeping our metrics implementation - Integrated upstream database migrations and services - Preserved rate limiting with metrics tracking - Combined authentication and privacy middleware - Maintained our monitoring and observability features - Added horizon listener and transaction processing - Integrated organization analytics and vault management
Contributor
Author
|
@1nonlypiece conflicts resolved |
Contributor
|
@gelluisaac Can you resolve the conflicts? |
- Resolved conflicts by keeping our metrics implementation - Integrated upstream enterprise models and sessions - Added notification system and team management - Preserved our rate limiting and metrics tracking - Combined authentication and privacy middleware - Added monitoring and organization services
Contributor
Author
|
@1nonlypiece conflictes resolved |
Contributor
Author
|
@1nonlypiece conflict resolved Please review |
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.
Prometheus monitoring and metrics have been successfully implemented for the Disciplr backend.
Files Created/Modified
src/middleware/metrics.ts - Comprehensive metrics collection middleware
src/routes/metrics.ts - /metrics endpoint for Prometheus scraping
src/middleware/rateLimiter.ts - Updated with metrics integration
src/routes/vaults.ts - Added vault operation metrics tracking
src/app.ts - Integrated metrics middleware and routes
docs/grafana-dashboard.md - Complete Grafana dashboard documentation
Metrics Available
HTTP Performance Metrics
Request Rate: disciplr_http_requests_total - Total requests by method, route, status
Response Time: disciplr_http_request_duration_seconds - Histogram with 95th/50th percentiles
Error Rate: disciplr_http_errors_total - 4xx/5xx responses tracking
Application Metrics
Active Vaults: disciplr_active_vaults_total - Real-time active vault count
Vault Operations: disciplr_vault_operations_total - Operations by type and status
Rate Limit Breaches: disciplr_rate_limit_breaches_total - Security monitoring
Database Connections: disciplr_database_connections_active - Connection pool health
Deadline Backlog: disciplr_deadline_processing_backlog - Queue depth monitoring
Process Metrics (Default)
CPU Usage: disciplr_process_cpu_seconds_total
Memory Usage: disciplr_process_resident_memory_bytes
Heap Usage: disciplr_nodejs_heap_size_used_bytes
GC Duration: Garbage collection performance
Key Features
Standard Prometheus format with disciplr_ prefix
Automatic middleware tracking all HTTP requests
Custom metrics for business logic (vaults, rate limiting)
Rate limiting integration with breach logging
Grafana dashboard with 10 panels covering all aspects
Alerting rules for operational monitoring
closes #37