0
# Built-in Endpoints
1
2
Spring Boot Actuator provides numerous production-ready endpoints out of the box for monitoring, management, and diagnostics. These endpoints expose operational information about the running application and can be accessed via HTTP or JMX.
3
4
## Capabilities
5
6
### Health Endpoint
7
8
Provides application health information with support for custom health indicators.
9
10
```java { .api }
11
/**
12
* Endpoint for application health information
13
*/
14
@Endpoint(id = "health")
15
public class HealthEndpoint {
16
17
/**
18
* Get overall application health
19
* @return the health information
20
*/
21
@ReadOperation
22
public HealthComponent health() { /* ... */ }
23
24
/**
25
* Get health for a specific path
26
* @param path the health path segments
27
* @return the health information for the path
28
*/
29
@ReadOperation
30
public HealthComponent healthForPath(@Selector String... path) { /* ... */ }
31
}
32
```
33
34
### Info Endpoint
35
36
Exposes arbitrary application information contributed by InfoContributor beans.
37
38
```java { .api }
39
/**
40
* Endpoint for application information
41
*/
42
@Endpoint(id = "info")
43
public class InfoEndpoint {
44
45
/**
46
* Get application information
47
* @return the application information
48
*/
49
@ReadOperation
50
public Map<String, Object> info() { /* ... */ }
51
}
52
```
53
54
### Metrics Endpoint
55
56
Provides access to application metrics collected by Micrometer.
57
58
```java { .api }
59
/**
60
* Endpoint for application metrics
61
*/
62
@Endpoint(id = "metrics")
63
public class MetricsEndpoint {
64
65
/**
66
* List all available metric names
67
* @return response containing metric names
68
*/
69
@ReadOperation
70
public ListNamesResponse listNames() { /* ... */ }
71
72
/**
73
* Get metric details for a specific metric
74
* @param requiredMetricName the metric name
75
* @param tag optional tag filters
76
* @return the metric response
77
*/
78
@ReadOperation
79
public MetricResponse metric(@Selector String requiredMetricName,
80
@Nullable List<String> tag) { /* ... */ }
81
82
/**
83
* Response containing available metric names
84
*/
85
public static final class ListNamesResponse {
86
private final Set<String> names;
87
88
public Set<String> getNames() { return this.names; }
89
}
90
91
/**
92
* Response containing metric details
93
*/
94
public static final class MetricResponse {
95
private final String name;
96
private final String description;
97
private final String baseUnit;
98
private final List<Sample> measurements;
99
private final List<AvailableTag> availableTags;
100
101
// Getters...
102
}
103
}
104
```
105
106
### Environment Endpoint
107
108
Exposes properties from the Spring Environment including configuration properties.
109
110
```java { .api }
111
/**
112
* Endpoint for environment properties
113
*/
114
@Endpoint(id = "env")
115
public class EnvironmentEndpoint {
116
117
/**
118
* Get all environment information
119
* @return the environment descriptor
120
*/
121
@ReadOperation
122
public EnvironmentDescriptor environment() { /* ... */ }
123
124
/**
125
* Get environment information for a specific property
126
* @param toMatch the property name pattern
127
* @return the environment entry descriptor
128
*/
129
@ReadOperation
130
public EnvironmentEntryDescriptor environmentEntry(@Selector String toMatch) { /* ... */ }
131
132
/**
133
* Set an environment property (if enabled)
134
* @param toMatch the property name
135
* @param value the property value
136
* @return the property descriptor
137
*/
138
@WriteOperation
139
public PropertyDescriptor setProperty(@Selector String toMatch,
140
@Nullable String value) { /* ... */ }
141
142
/**
143
* Delete an environment property (if enabled)
144
* @param toMatch the property name
145
* @return the property descriptor
146
*/
147
@DeleteOperation
148
public PropertyDescriptor deleteProperty(@Selector String toMatch) { /* ... */ }
149
}
150
```
151
152
### Configuration Properties Endpoint
153
154
Shows all @ConfigurationProperties beans and their current values.
155
156
```java { .api }
157
/**
158
* Endpoint for configuration properties report
159
*/
160
@Endpoint(id = "configprops")
161
public class ConfigurationPropertiesReportEndpoint {
162
163
/**
164
* Get configuration properties report
165
* @return the configuration properties report
166
*/
167
@ReadOperation
168
public ConfigurationPropertiesReport configurationProperties() { /* ... */ }
169
170
/**
171
* Get configuration properties for a specific bean
172
* @param beanName the bean name
173
* @return the configuration properties bean
174
*/
175
@ReadOperation
176
public ConfigurationPropertiesBean configurationPropertiesBean(@Selector String beanName) { /* ... */ }
177
}
178
```
179
180
### Beans Endpoint
181
182
Lists all Spring beans in the application context.
183
184
```java { .api }
185
/**
186
* Endpoint for Spring beans information
187
*/
188
@Endpoint(id = "beans")
189
public class BeansEndpoint {
190
191
/**
192
* Get information about all Spring beans
193
* @return the beans report
194
*/
195
@ReadOperation
196
public BeansReport beans() { /* ... */ }
197
198
/**
199
* Describes Spring beans
200
*/
201
public static final class BeansReport {
202
private final Map<String, ContextBeans> contexts;
203
204
public Map<String, ContextBeans> getContexts() { return this.contexts; }
205
}
206
}
207
```
208
209
### Loggers Endpoint
210
211
Manages logger levels at runtime, allowing dynamic log level changes.
212
213
```java { .api }
214
/**
215
* Endpoint for logger configuration
216
*/
217
@Endpoint(id = "loggers")
218
public class LoggersEndpoint {
219
220
/**
221
* Get all logger configurations
222
* @return the loggers report
223
*/
224
@ReadOperation
225
public LoggersReport loggers() { /* ... */ }
226
227
/**
228
* Get configuration for a specific logger
229
* @param name the logger name
230
* @return the logger configuration
231
*/
232
@ReadOperation
233
public LoggerConfiguration loggerConfiguration(@Selector String name) { /* ... */ }
234
235
/**
236
* Set logger level
237
* @param name the logger name
238
* @param configuredLevel the level to set
239
*/
240
@WriteOperation
241
public void configureLogLevel(@Selector String name,
242
@Nullable LogLevel configuredLevel) { /* ... */ }
243
}
244
```
245
246
### Scheduled Tasks Endpoint
247
248
Shows information about scheduled tasks in the application.
249
250
```java { .api }
251
/**
252
* Endpoint for scheduled tasks information
253
*/
254
@Endpoint(id = "scheduledtasks")
255
public class ScheduledTasksEndpoint {
256
257
/**
258
* Get scheduled tasks report
259
* @return the scheduled tasks report
260
*/
261
@ReadOperation
262
public ScheduledTasksReport scheduledTasks() { /* ... */ }
263
}
264
```
265
266
### Shutdown Endpoint
267
268
Allows graceful shutdown of the application (disabled by default).
269
270
```java { .api }
271
/**
272
* Endpoint for application shutdown
273
*/
274
@Endpoint(id = "shutdown", defaultAccess = Access.RESTRICTED)
275
public class ShutdownEndpoint {
276
277
/**
278
* Shutdown the application
279
* @return shutdown confirmation message
280
*/
281
@WriteOperation
282
public Map<String, String> shutdown() { /* ... */ }
283
}
284
```
285
286
### Thread Dump Endpoint
287
288
Provides thread dump information for diagnostics.
289
290
```java { .api }
291
/**
292
* Endpoint for thread dump information
293
*/
294
@Endpoint(id = "threaddump")
295
public class ThreadDumpEndpoint {
296
297
/**
298
* Get thread dump
299
* @return the thread dump
300
*/
301
@ReadOperation
302
public ThreadDumpDescriptor threadDump() { /* ... */ }
303
}
304
```
305
306
### Heap Dump Web Endpoint
307
308
Web-specific endpoint for downloading heap dumps.
309
310
```java { .api }
311
/**
312
* Web endpoint for heap dump download
313
*/
314
@EndpointWebExtension(endpoint = HeapDumpEndpoint.class)
315
public class HeapDumpWebEndpoint {
316
317
/**
318
* Download heap dump
319
* @return heap dump as Resource
320
*/
321
@ReadOperation(produces = "application/octet-stream")
322
public Resource heapDump() { /* ... */ }
323
}
324
```
325
326
### Audit Events Endpoint
327
328
Exposes audit events for security monitoring.
329
330
```java { .api }
331
/**
332
* Endpoint for audit events
333
*/
334
@Endpoint(id = "auditevents")
335
public class AuditEventsEndpoint {
336
337
/**
338
* Get audit events
339
* @param after events after this date
340
* @param principal filter by principal
341
* @param type filter by event type
342
* @return the audit events report
343
*/
344
@ReadOperation
345
public AuditEventsDescriptor auditEvents(@Nullable OffsetDateTime after,
346
@Nullable String principal,
347
@Nullable String type) { /* ... */ }
348
}
349
```
350
351
### Integration-Specific Endpoints
352
353
#### Flyway Endpoint
354
355
Information about Flyway database migrations.
356
357
```java { .api }
358
/**
359
* Endpoint for Flyway migration information
360
*/
361
@Endpoint(id = "flyway")
362
public class FlywayEndpoint {
363
364
/**
365
* Get Flyway migration information
366
* @return the Flyway report
367
*/
368
@ReadOperation
369
public FlywayReport flyway() { /* ... */ }
370
371
/**
372
* Get Flyway information for a specific context
373
* @param name the context name
374
* @return the Flyway context
375
*/
376
@ReadOperation
377
public FlywayContext flywayByName(@Selector String name) { /* ... */ }
378
}
379
```
380
381
#### Liquibase Endpoint
382
383
Information about Liquibase database changesets.
384
385
```java { .api }
386
/**
387
* Endpoint for Liquibase changelog information
388
*/
389
@Endpoint(id = "liquibase")
390
public class LiquibaseEndpoint {
391
392
/**
393
* Get Liquibase changelog information
394
* @return the Liquibase report
395
*/
396
@ReadOperation
397
public LiquibaseReport liquibase() { /* ... */ }
398
399
/**
400
* Get Liquibase information for a specific context
401
* @param name the context name
402
* @return the Liquibase context
403
*/
404
@ReadOperation
405
public LiquibaseContext liquibaseByName(@Selector String name) { /* ... */ }
406
}
407
```
408
409
#### Quartz Endpoint
410
411
Information about Quartz scheduler jobs and triggers.
412
413
```java { .api }
414
/**
415
* Endpoint for Quartz scheduler information
416
*/
417
@Endpoint(id = "quartz")
418
public class QuartzEndpoint {
419
420
/**
421
* Get Quartz scheduler report
422
* @return the Quartz report
423
*/
424
@ReadOperation
425
public QuartzReport quartz() { /* ... */ }
426
427
/**
428
* Get job details
429
* @param group the job group
430
* @param name the job name
431
* @return the job details
432
*/
433
@ReadOperation
434
public QuartzJobDetails quartzJob(@Selector String group,
435
@Selector String name) { /* ... */ }
436
437
/**
438
* Get trigger details
439
* @param group the trigger group
440
* @param name the trigger name
441
* @return the trigger details
442
*/
443
@ReadOperation
444
public QuartzTriggerDetails quartzTrigger(@Selector String group,
445
@Selector String name) { /* ... */ }
446
}
447
```
448
449
#### Integration Graph Endpoint
450
451
Spring Integration message flow visualization.
452
453
```java { .api }
454
/**
455
* Endpoint for Spring Integration graph
456
*/
457
@Endpoint(id = "integrationgraph")
458
public class IntegrationGraphEndpoint {
459
460
/**
461
* Get integration graph
462
* @return the integration graph
463
*/
464
@ReadOperation
465
public Map<String, Object> graph() { /* ... */ }
466
467
/**
468
* Rebuild the integration graph
469
* @return rebuild confirmation
470
*/
471
@WriteOperation
472
public Map<String, Object> rebuild() { /* ... */ }
473
}
474
```
475
476
#### SBOM Endpoint
477
478
Software Bill of Materials information.
479
480
```java { .api }
481
/**
482
* Endpoint for Software Bill of Materials
483
*/
484
@Endpoint(id = "sbom")
485
public class SbomEndpoint {
486
487
/**
488
* Get SBOM information
489
* @return the SBOM report
490
*/
491
@ReadOperation
492
public SbomReport sbom() { /* ... */ }
493
494
/**
495
* Get SBOM for a specific ID
496
* @param id the SBOM ID
497
* @return the SBOM details
498
*/
499
@ReadOperation
500
public Object sbomById(@Selector String id) { /* ... */ }
501
}
502
```
503
504
## Usage Examples
505
506
### Accessing Endpoints via HTTP
507
508
```bash
509
# Health check
510
curl http://localhost:8080/actuator/health
511
512
# Application info
513
curl http://localhost:8080/actuator/info
514
515
# All available metrics
516
curl http://localhost:8080/actuator/metrics
517
518
# Specific metric
519
curl http://localhost:8080/actuator/metrics/jvm.memory.used
520
521
# Environment properties
522
curl http://localhost:8080/actuator/env
523
524
# Specific property
525
curl http://localhost:8080/actuator/env/server.port
526
527
# Logger levels
528
curl http://localhost:8080/actuator/loggers
529
530
# Change logger level
531
curl -X POST http://localhost:8080/actuator/loggers/com.example \
532
-H 'Content-Type: application/json' \
533
-d '{"configuredLevel": "DEBUG"}'
534
```
535
536
### Programmatic Access
537
538
```java
539
@RestController
540
public class ManagementController {
541
542
private final HealthEndpoint healthEndpoint;
543
private final MetricsEndpoint metricsEndpoint;
544
545
public ManagementController(HealthEndpoint healthEndpoint,
546
MetricsEndpoint metricsEndpoint) {
547
this.healthEndpoint = healthEndpoint;
548
this.metricsEndpoint = metricsEndpoint;
549
}
550
551
@GetMapping("/custom-health")
552
public HealthComponent getHealth() {
553
return healthEndpoint.health();
554
}
555
556
@GetMapping("/memory-metrics")
557
public MetricsEndpoint.MetricResponse getMemoryMetrics() {
558
return metricsEndpoint.metric("jvm.memory.used", List.of("area:heap"));
559
}
560
}
561
```
562
563
## Configuration
564
565
Built-in endpoints can be configured through application properties:
566
567
```properties
568
# Expose specific endpoints
569
management.endpoints.web.exposure.include=health,info,metrics,loggers
570
571
# Expose all endpoints (not recommended for production)
572
management.endpoints.web.exposure.include=*
573
574
# Exclude specific endpoints
575
management.endpoints.web.exposure.exclude=env,configprops
576
577
# Enable shutdown endpoint (disabled by default)
578
management.endpoint.shutdown.enabled=true
579
580
# Configure health endpoint
581
management.endpoint.health.show-details=when-authorized
582
management.endpoint.health.show-components=always
583
584
# Configure info endpoint
585
management.info.build.enabled=true
586
management.info.git.enabled=true
587
management.info.java.enabled=true
588
589
# Configure metrics endpoint
590
management.endpoint.metrics.enabled=true
591
592
# Enable environment endpoint write operations
593
management.endpoint.env.post.enabled=true
594
595
# Configure loggers endpoint
596
management.endpoint.loggers.enabled=true
597
598
# Change base path
599
management.endpoints.web.base-path=/manage
600
601
# Use different port for management endpoints
602
management.server.port=8081
603
```
604
605
## Security Considerations
606
607
Many built-in endpoints expose sensitive information:
608
609
- **env**: Environment variables and configuration properties
610
- **configprops**: Configuration property values
611
- **beans**: Spring bean information
612
- **threaddump**: Thread dump information
613
- **heapdump**: Memory dump download
614
- **shutdown**: Application shutdown capability
615
616
Ensure proper security configuration:
617
618
```properties
619
# Restrict sensitive endpoints
620
management.endpoint.env.enabled=false
621
management.endpoint.configprops.enabled=false
622
management.endpoint.shutdown.enabled=false
623
624
# Or secure them with Spring Security
625
management.endpoints.web.exposure.include=*
626
# Configure Spring Security to protect /actuator/** endpoints
627
```