Monitoring Your Spring Boot Application with Vigilmon: Actuator Health + External Uptime
Spring Boot applications power enterprise backends worldwide. Spring Boot Actuator provides internal health endpoints — but you also need external monitoring to verify users can actually reach your service. This guide combines Spring Actuator with Vigilmon for comprehensive coverage.
Spring Boot Actuator Health Endpoint
Spring Boot Actuator ships a /actuator/health endpoint out of the box.
Setup
Add to pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Or build.gradle:
implementation 'org.springframework.boot:spring-boot-starter-actuator'
Configure in application.yml:
management:
endpoints:
web:
exposure:
include: health
endpoint:
health:
show-details: when-authorized
health:
defaults:
enabled: true
This exposes GET /actuator/health which returns:
{"status":"UP"}
Custom Health Indicator
Add custom health checks:
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
@Component
public class DatabaseHealthIndicator implements HealthIndicator {
private final DataSource dataSource;
public DatabaseHealthIndicator(DataSource dataSource) {
this.dataSource = dataSource;
}
@Override
public Health health() {
try (Connection conn = dataSource.getConnection()) {
conn.prepareStatement("SELECT 1").execute();
return Health.up().withDetail("database", "reachable").build();
} catch (Exception e) {
return Health.down().withDetail("error", e.getMessage()).build();
}
}
}
Expose a Simple Health Endpoint
If you prefer a simple endpoint without Actuator:
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
public class HealthController {
@GetMapping("/health")
public ResponseEntity<Map<String, String>> health() {
return ResponseEntity.ok(Map.of("status", "ok"));
}
}
Setting Up Vigilmon for Spring Boot
- Sign up at vigilmon.online
- Click Add Monitor
- URL:
https://your-spring-app.com/actuator/healthor/health - Check interval: 1 or 5 minutes
- Alert channels: email and/or webhook
- Expected status: 200
- Save
Vigilmon checks from multiple geographic regions. Only alerts when 2+ regions agree your endpoint is down — no false alerts from regional network blips.
Security Consideration: Protecting Actuator Endpoints
Be careful about publicly exposing /actuator/health with full details. Use Spring Security to restrict sensitive details:
management:
endpoint:
health:
show-details: when-authorized # Only full details when authenticated
show-components: always # Component statuses always visible
For Vigilmon, the public /health endpoint returning {"status": "UP"} is sufficient. Keep sensitive Actuator endpoints (env, beans, etc.) behind authentication.
What to Monitor
| Monitor | URL | Notes |
|---|---|---|
| Main health | /actuator/health |
Core app status |
| Specific service | /health |
Your custom endpoint |
| API entry point | /api/v1/ping |
Specific API working |
| Auth endpoint | /api/auth/verify |
Auth service up |
Kubernetes Integration
spec:
containers:
- name: spring-app
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 60
periodSeconds: 10
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 30
periodSeconds: 5
Then add https://your-public-domain.com/actuator/health to Vigilmon for external monitoring.
Conclusion
Spring Boot Actuator gives you internal health visibility. Vigilmon gives you external uptime monitoring — verifying that users around the world can actually reach your service. Together they provide complete coverage.
Start free at vigilmon.online — 5 monitors, no credit card, live in 2 minutes.