Application Monitoring Pattern
Monitor application health and debug production issues with OpenTelemetry tracing, Prometheus metrics, Sentry error tracking, and structured logging.
What's Included#
- OpenTelemetry SDK setup with auto-instrumentation and OTLP trace export
- Custom Prometheus metrics for HTTP requests, durations, and business events
- Sentry integration for error tracking with session replay and breadcrumbs
- Health check endpoints for database, Redis, and Kubernetes liveness/readiness probes
- Request tracing middleware with correlation IDs across services
- Structured JSON logging with level-based output and production log aggregation
Usage#
Via CLI#
Loading code block...
Via AI Assistant#
Ask your AI assistant:
- "Use the application monitoring pattern from Bootspring"
- "Apply the Bootspring monitoring pattern to my project"
Key Considerations#
- Use correlation IDs on every request to trace issues across services and log entries
- Structure logs as JSON in production for easy parsing by log aggregation tools
- Focus metrics on business-relevant data (signups, payments) not just technical indicators
- Set alert thresholds that trigger before users notice degradation
- Sample high-volume traces in production to control costs while maintaining visibility
Related Patterns#
- CI/CD - Deployment automation
- Profiling - Performance analysis
- Error Handling - Error responses and handling