Spring Boot Integration
If you're building a Spring Boot application (3.2+), you don't need to use the -javaagent flag at all. Just add a single dependency and Argus starts automatically with your application.
Setup
// build.gradle.kts
implementation("io.argus:argus-spring-boot-starter:1.5.0")
When your Spring Boot application starts, Argus will:
- Start the JFR streaming engine automatically
- Launch the dashboard on port 9202
- Register with Spring Boot Actuator at
/actuator/argus-doctor,/actuator/argus-doctor/{pid}, and/actuator/argus-gc(all modes exceptoff) - Register
/actuator/health/argusreporting JFR engine + server status (mode=fullonly) - Export ~25 Micrometer metrics to your configured backend (Prometheus, Datadog, etc.)
Configuration via application.yml
argus:
mode: full # full | diagnostics | off
buffer-size: 65536
server:
port: 9202
gc:
enabled: true
cpu:
enabled: true
interval-ms: 1000
allocation:
enabled: true
threshold: 1048576
doctor:
gc-log-path: /var/log/app/gc.log # required for /actuator/argus-gc to return data
metrics:
prometheus:
enabled: true # default true; exposes /prometheus scrape endpoint
All properties have IDE autocomplete support. The defaults match the standard agent configuration.
Diagnostics-only mode (production-safe)
For production deployments where you don't want a daemon HTTP server listening on port 9202 or a JFR stream running 24/7, set argus.mode=diagnostics. You still get the analysis primitives as Spring beans plus actuator endpoints — without the runtime cost of the full mode.
argus:
mode: diagnostics # 'full' | 'diagnostics' | 'off'
doctor:
schedule:
enabled: true # optional: run doctor every interval
interval-ms: 60000
management:
endpoints:
web:
exposure:
include: argus-doctor,argus-gc
The scheduled doctor requires argus.doctor.schedule.enabled=true. The starter's auto-configuration activates Spring scheduling automatically when this flag is set — no @EnableScheduling annotation is needed in your application code.
Programmatic API beans
Three injectable services let application code run Argus analyses directly:
@Autowired DoctorService doctor;
@GetMapping("/admin/health/jvm")
public List<Finding> jvmHealth() {
return doctor.diagnoseLocal(); // or doctor.diagnoseRemote(pid)
}
DoctorService— diagnoseLocal / diagnoseRemote(pid) / diagnose(snapshot) / lastCollectionWarnings()GcLogAnalyzerService— analyze(Path) / analyze(List<GcEvent>)GcScoreService— score(analysis [, gcAlgorithm]) / inferAlgorithm
All three are @ConditionalOnMissingBean so applications can override with custom implementations.
Actuator endpoints
GET /actuator/argus-doctor # diagnose the local JVM
GET /actuator/argus-doctor/{pid} # diagnose a remote JVM via jcmd
GET /actuator/argus-gc # GC log analysis + score
Opt in via the standard management.endpoints.web.exposure.include gate. Responses are explicit Map<String, Object> shapes so the JSON contract is stable across Jackson versions.
Micrometer Metrics
When Micrometer is on the classpath (it is in most Spring Boot apps), Argus automatically registers ~25 JVM diagnostic metrics:
# Example Prometheus queries
argus_heap_used_bytes # Current heap usage
argus_gc_pause_time_max_seconds # Worst GC pause
argus_cpu_jvm_user_ratio * 100 # JVM CPU %
argus_virtual_threads_active # Active virtual threads
argus_allocation_rate_bytes_per_second # Allocation pressure
Framework-agnostic: The argus-micrometer module works without Spring. If you're using Quarkus, Micronaut, or standalone Micrometer, add argus-micrometer directly and register the ArgusMeterBinder with your MeterRegistry.