Overview
StreamLine Logistics implements multiple layers of monitoring through Spring Boot Actuator, Eureka service registry, and container-level health checks. This comprehensive approach ensures early detection of issues and maintains system reliability.Spring Boot Actuator
All microservices include Spring Boot Actuator for health monitoring, metrics, and operational insights.Actuator Endpoints
By default, Spring Boot Actuator exposes several endpoints:Order Service (Port 8090)
Inventory Service (Port 9090)
Tracking Service (Port 8091)
Health Check Response Format
A healthy service returns:Enabling Additional Actuator Endpoints
To expose more endpoints, add toapplication.yml:
Key Metrics to Monitor
JVM Metrics
HTTP Metrics
Database Connection Pool
Eureka Service Registry
Eureka Server provides centralized service discovery and health monitoring.Eureka Dashboard
Access the Eureka dashboard at:- Registered service instances
- Instance status (UP/DOWN)
- Last heartbeat time
- Service URLs and ports
Registered Services
The following services register with Eureka:- msvc-order (Order Service) - Port 8090
- msvc-inventory (Inventory Service) - Port 9090
- msvc-tracking (Tracking Service) - Port 8091
Eureka REST API
Service Heartbeat Configuration
Services send heartbeats to Eureka every 30 seconds by default:Container Health Monitoring
Docker Container Status
Container Resource Usage
Container Logs
Database Health Monitoring
PostgreSQL (Order Database)
MySQL (Inventory Database)
MongoDB (Tracking Database)
API Gateway Monitoring
The API Gateway (port 8080) serves as the single entry point:Monitoring Best Practices
Health Check Endpoints
Implement custom health indicators for critical dependencies:Automated Monitoring Script
Create a monitoring script to check all services:Alerting Thresholds
Monitor these metrics and set up alerts:| Metric | Warning Threshold | Critical Threshold |
|---|---|---|
| JVM Heap Usage | > 75% | > 90% |
| Database Connections | > 80% pool size | > 95% pool size |
| Response Time (p95) | > 1000ms | > 3000ms |
| Error Rate | > 1% | > 5% |
| Disk Space | < 20% free | < 10% free |
| CPU Usage | > 70% | > 90% |