Overview
SGIVU microservices use Spring Boot Actuator for health checks and metrics, combined with Zipkin for distributed tracing. This guide shows how to monitor the Config Server and microservices.Spring Boot Actuator Configuration
All microservices expose actuator endpoints for health monitoring and operational insights.Production Configuration
In production profiles, services expose minimal endpoints for security:The
show-details: never setting prevents sensitive information from being exposed in health endpoint responses.Development Configuration
Development environments expose all actuator endpoints for debugging:Health Check Endpoints
Accessing Health Status
Each microservice exposes a health check endpoint:Config Server
Discovery Server
API Gateway
Auth Service
Health Response Format
Production (show-details: never):Health status can be
UP, DOWN, OUT_OF_SERVICE, or UNKNOWN. Services should be monitored for non-UP statuses.Info Endpoint
The/actuator/info endpoint provides application metadata:
Distributed Tracing with Zipkin
Zipkin Configuration
All microservices are configured to send trace data to Zipkin:Understanding Sampling Probability
Theprobability setting controls what percentage of requests are traced:
0.1 (10%)
Production default - traces 1 in 10 requests to reduce overhead
0.5 (50%)
Higher sampling for debugging issues in staging
1.0 (100%)
Development - trace every request (high overhead)
Accessing Zipkin Dashboard
Once Zipkin is running, access the dashboard:Trace Search and Analysis
View Trace Timeline
Click a trace to see the request flow across microservices with timing information.
Example Trace Flow
A typical request through SGIVU might create this trace:Monitoring Config Server
Config Server Health
The Config Server health includes Git repository connectivity:Monitoring Configuration Retrieval
Test that services can retrieve their configuration:Service-Level Monitoring
Key Metrics by Service
sgivu-auth (Port 9000)
sgivu-auth (Port 9000)
Key Metrics:
- OAuth2 token generation rate
- JWT signing operations
- Session creation/validation
- Database connection pool usage
- PostgreSQL database
- JWT keystore availability
- Eureka registration
sgivu-gateway (Port 8080)
sgivu-gateway (Port 8080)
Key Metrics:
- Request throughput and latency
- OAuth2 token relay success rate
- Redis session operations
- Circuit breaker status
- Redis connection
- Auth service availability
- Eureka service discovery
sgivu-user (Port 8081)
sgivu-user (Port 8081)
Key Metrics:
- User lookup latency
- Database query performance
- Internal API call success rate
- PostgreSQL database
- Service internal authentication
- Eureka registration
sgivu-client (Port 8082)
sgivu-client (Port 8082)
Key Metrics:
- Client data operations
- Database transaction rate
- API response times
- PostgreSQL database
- Service internal authentication
- Eureka registration
sgivu-vehicle (Port 8083)
sgivu-vehicle (Port 8083)
Key Metrics:
- Vehicle image upload success rate
- S3 operation latency
- File size and multipart upload metrics
- PostgreSQL database
- AWS S3 connectivity
- Service internal authentication
Logging Configuration
Production Logging
Production services use INFO level logging:Development Debugging
Development profiles enable detailed logging for troubleshooting:Debug logging is useful for tracing OAuth2 flows, session management, and security filters during development.
Automated Monitoring Setup
Docker Compose Health Checks
Add health checks to yourdocker-compose.yml:
Kubernetes Probes
For Kubernetes deployments:Monitoring Best Practices
Set Up Alerts
Configure alerts for DOWN health status, high error rates, or slow response times.
Monitor Dependencies
Track database connections, Redis availability, and Eureka registration status.
Track Trends
Collect metrics over time to identify gradual degradation or capacity issues.
Correlate Logs
Use trace IDs to correlate logs across services when debugging issues.
Troubleshooting Common Issues
Service Reports DOWN
High Latency in Traces
- Identify the slow span in Zipkin
- Check database query performance if the slow span is a repository call
- Review network latency between services
- Check resource utilization (CPU, memory, disk I/O)
Missing Traces
- Verify Zipkin is running and accessible
- Check that
management.zipkin.tracing.endpointis correctly configured - Increase
sampling.probabilitytemporarily for debugging - Review service logs for Zipkin connection errors
Related Resources
Configuration Refresh
Update monitoring configuration without restarts
Security
Secure actuator endpoints in production
Validation
Validate configuration changes before deployment
Troubleshooting
Debug common configuration issues