Week 3 Day 4 — Spring Boot Actuator: Health, Metrics, Info, Beans, Conditions, and Production Monitoring
Goal
Today I want to understand Spring Boot Actuator.
Main questions:
- What is Spring Boot Actuator?
- Why do we need Actuator?
- How do I add Actuator?
- What are Actuator endpoints?
- What is
/actuator/health? - What is
/actuator/info? - What is
/actuator/metrics? - What is
/actuator/beans? - What is
/actuator/conditions? - What is
/actuator/configprops? - How do I expose endpoints?
- Why should I secure Actuator endpoints?
- What are common exam traps?
1. Quick Review from Week 3 Day 3
In Day 3, I learned:
- Auto-configuration is conditional bean configuration.
- Spring Boot checks classpath, properties, existing beans, profiles, and application type.
- Starters bring dependencies.
- Auto-configuration configures beans.
@ConditionalOnMissingBeanlets Boot back off./actuator/conditionscan help debug auto-configuration.
Memory sentence:
Starters bring libraries.
Auto-configuration configures them.
Conditions decide if configuration applies.
Today I learn Actuator, which helps me observe and manage a running Spring Boot app.
2. What Is Spring Boot Actuator?
Spring Boot Actuator provides production-ready features for monitoring and managing a Spring Boot application.
Simple definition:
Actuator exposes operational information about a running Spring Boot application.
Actuator can show information about:
health
metrics
application info
beans
configuration properties
auto-configuration conditions
environment properties
loggers
HTTP mappings
thread dumps
caches
scheduled tasks
database migrations
Memory sentence:
Actuator helps me understand what is happening inside a running Spring Boot app.
3. Why Do We Need Actuator?
In production, I need to answer questions like:
Is the application alive?
Is the database reachable?
How much memory is used?
How many HTTP requests are coming in?
Which beans exist?
Which auto-configurations matched?
Which configuration properties are bound?
Which endpoints are mapped?
Are there slow or failing dependencies?
Without Actuator, I would need to build many of these checks manually.
With Actuator, Spring Boot gives many of them out of the box.
4. How to Add Actuator
Gradle:
implementation("org.springframework.boot:spring-boot-starter-actuator")
Maven:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
This starter adds Actuator support.
Then Spring Boot auto-configuration creates Actuator endpoints.
Memory sentence:
Actuator starter brings the dependency. Actuator auto-configuration creates the endpoints.
5. What Is an Actuator Endpoint?
An Actuator endpoint is an operational endpoint that exposes information or management actions.
Example URLs:
/actuator/health
/actuator/info
/actuator/metrics
/actuator/beans
/actuator/conditions
/actuator/configprops
Default base path:
/actuator
Example:
health endpoint ID = health
HTTP URL = /actuator/health
6. Common Actuator Endpoints
| Endpoint | Purpose |
|---|---|
health | shows application health |
info | shows application info |
metrics | shows metrics |
beans | shows Spring beans |
conditions | shows auto-configuration condition report |
configprops | shows @ConfigurationProperties values |
env | shows environment properties |
loggers | shows and modifies logging levels |
mappings | shows request mappings |
threaddump | shows thread dump |
scheduledtasks | shows scheduled tasks |
caches | shows cache information |
For certification, focus most on:
health
info
metrics
beans
conditions
configprops
env
loggers
mappings
7. Endpoint Availability vs Exposure
This is an important concept.
There are two different ideas:
enabled
exposed
Enabled
The endpoint is available inside the application.
Exposed
The endpoint can be accessed remotely, for example over HTTP.
Memory sentence:
Enabled means the endpoint exists. Exposed means I can access it remotely.
8. Default HTTP Exposure
By default, Spring Boot exposes only limited Actuator endpoints over HTTP.
Current official docs say:
Only health is exposed over HTTP by default.
This is for security reasons.
Why?
Because endpoints like these may reveal sensitive information:
env
beans
configprops
conditions
mappings
Memory sentence:
Do not expose sensitive Actuator endpoints publicly.
9. Exposing Specific Endpoints
Example:
management:
endpoints:
web:
exposure:
include: health,info,metrics
This exposes:
/actuator/health
/actuator/info
/actuator/metrics
Properties format:
management.endpoints.web.exposure.include=health,info,metrics
10. Exposing All Endpoints
You can expose all endpoints:
management:
endpoints:
web:
exposure:
include: "*"
Important YAML detail:
Use quotes around "*".
Why?
Because * has special meaning in YAML.
Properties format:
management.endpoints.web.exposure.include=*
But be careful.
This is dangerous in production unless properly secured.
11. Excluding Endpoints
You can expose many endpoints but exclude some.
Example:
management:
endpoints:
web:
exposure:
include: "*"
exclude: env,beans
Meaning:
Expose all endpoints except env and beans.
Important:
Exclude has priority over include.
12. Changing the Actuator Base Path
Default:
/actuator
Custom:
management:
endpoints:
web:
base-path: /manage
Then:
/actuator/health
becomes:
/manage/health
Use this only when needed.
Most applications keep:
/actuator
13. Running Actuator on Another Port
Sometimes management endpoints should run on a separate port.
Example:
management:
server:
port: 9090
Application:
http://localhost:8080
Actuator:
http://localhost:9090/actuator/health
This can help separate public traffic from management traffic.
In production, infrastructure often restricts access to the management port.
14. /actuator/health
The health endpoint shows application health.
Example:
{
"status": "UP"
}
Common statuses:
UP
DOWN
OUT_OF_SERVICE
UNKNOWN
Simple meaning:
UP = application is healthy
DOWN = application has a problem
OUT_OF_SERVICE = application is not available for service
UNKNOWN = health status cannot be determined
Memory sentence:
/actuator/healthtells monitoring systems whether the app is healthy.
15. Health and HTTP Status Codes
Typical behavior:
UP -> HTTP 200
DOWN -> HTTP 503
OUT_OF_SERVICE -> HTTP 503
Why important?
Load balancers, Kubernetes, and monitoring systems can use this endpoint to decide whether the app should receive traffic.
16. Health Details
By default, health details may be hidden.
Example basic response:
{
"status": "UP"
}
To show more details:
management:
endpoint:
health:
show-details: always
Possible values:
never
when-authorized
always
Security warning:
Do not show sensitive health details publicly in production.
17. Health Contributors and Health Indicators
Spring Boot can collect health from different components.
Examples:
database
disk space
mail server
Redis
MongoDB
RabbitMQ
custom external API
A health indicator checks one part of the system.
Example idea:
DataSourceHealthIndicator checks database connectivity.
DiskSpaceHealthIndicator checks disk space.
Overall health is built from these contributors.
18. Custom HealthIndicator
I can create my own health indicator.
Example:
@Component
public class TaxApiHealthIndicator implements HealthIndicator {
private final TaxApiClient taxApiClient;
public TaxApiHealthIndicator(TaxApiClient taxApiClient) {
this.taxApiClient = taxApiClient;
}
@Override
public Health health() {
boolean reachable = taxApiClient.isReachable();
if (reachable) {
return Health.up()
.withDetail("taxApi", "reachable")
.build();
}
return Health.down()
.withDetail("taxApi", "not reachable")
.build();
}
}
If the bean name is:
taxApiHealthIndicator
the health component is usually shown as:
taxApi
because Spring removes the HealthIndicator suffix.
19. Be Careful with Custom Health Checks
Health checks should be:
fast
safe
reliable
not too expensive
not dependent on slow external calls unless necessary
Bad health check:
calls 10 external services
runs a heavy database query
waits 30 seconds
modifies data
Good health check:
quick database ping
simple dependency status
cached external service status
Memory sentence:
Health checks should be fast and safe.
20. Readiness and Liveness
In cloud environments, health checks are often separated into:
liveness
readiness
Liveness
Is the app process alive?
If liveness fails, restart the app.
Readiness
Is the app ready to receive traffic?
If readiness fails, stop sending traffic to the app.
Example:
App is alive but database is temporarily unavailable.
Liveness may be UP.
Readiness may be DOWN.
This distinction is important in Kubernetes-style deployments.
21. /actuator/info
The info endpoint exposes application information.
Example:
{
"app": {
"name": "klarsync",
"version": "1.0.0"
}
}
Config example:
info:
app:
name: klarsync
description: Tax workflow platform
version: 1.0.0
Then:
/actuator/info
can show this data if the endpoint is exposed and info contributors are configured.
22. InfoContributor
I can create custom info.
@Component
public class BuildInfoContributor implements InfoContributor {
@Override
public void contribute(Info.Builder builder) {
builder.withDetail("app", Map.of(
"name", "klarsync",
"module", "backend"
));
}
}
Use InfoContributor when application info should come from code or runtime data.
23. What Should Go into /info?
Good:
application name
version
build time
git commit
environment name
module name
Bad:
passwords
API keys
tokens
internal private URLs
sensitive customer data
Memory sentence:
/infois for safe application metadata, not secrets.
24. /actuator/metrics
The metrics endpoint exposes application metrics.
Examples of metrics:
HTTP request count
HTTP request duration
JVM memory usage
CPU usage
thread count
garbage collection metrics
database connection pool metrics
Tomcat metrics
custom business metrics
Example:
/actuator/metrics
shows available metric names.
Example:
/actuator/metrics/jvm.memory.used
shows a specific metric.
25. Metrics and Micrometer
Spring Boot uses Micrometer as the metrics facade.
Simple definition:
Micrometer is a metrics instrumentation library used by Spring Boot to collect and export metrics.
Micrometer can work with monitoring systems such as:
Prometheus
Grafana
Datadog
New Relic
CloudWatch
Important for certification:
Know that Actuator exposes metrics and Spring Boot uses Micrometer for metrics.
26. Prometheus Endpoint
For Prometheus, add a registry dependency.
Example Gradle:
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
Then expose Prometheus endpoint:
management:
endpoints:
web:
exposure:
include: health,info,prometheus
Endpoint:
/actuator/prometheus
Prometheus can scrape this endpoint.
27. Custom Metrics
Example using MeterRegistry:
@Service
public class TaskService {
private final Counter createdTasksCounter;
public TaskService(MeterRegistry meterRegistry) {
this.createdTasksCounter = Counter.builder("tasks.created")
.description("Number of created tasks")
.register(meterRegistry);
}
public void createTask() {
createdTasksCounter.increment();
}
}
Metric name:
tasks.created
This is useful for business metrics.
28. Be Careful with Metric Cardinality
Bad metric tag:
userId
email
requestId
documentId
Why bad?
Because these values can create too many time series.
Good metric tags:
status
method
endpoint pattern
tenant type
operation type
Memory sentence:
Metrics tags should have low cardinality.
29. /actuator/beans
The beans endpoint shows Spring beans in the application context.
It can help answer:
Is my bean registered?
What is the bean name?
What is the bean type?
What dependencies does it have?
Which configuration created it?
Example use:
I created JwtProperties but injection fails.
Check /actuator/beans to see whether JwtProperties exists.
This endpoint is powerful for debugging.
But it can reveal internal structure, so do not expose it publicly.
30. /actuator/conditions
The conditions endpoint shows auto-configuration decisions.
It can answer:
Which auto-configurations matched?
Which did not match?
Why did they match?
Why did they not match?
Example use:
DataSourceAutoConfiguration matched because JDBC classes are present.
SecurityAutoConfiguration matched because Spring Security is on the classpath.
WebMvcAutoConfiguration did not match because this is not a servlet web app.
Memory sentence:
/actuator/conditionsis one of the best tools for debugging auto-configuration.
31. /actuator/configprops
The configprops endpoint shows @ConfigurationProperties beans.
It can help answer:
Did my properties class bind correctly?
Which values are currently bound?
Which configuration properties beans exist?
Example:
@ConfigurationProperties(prefix = "jwt")
public record JwtProperties(
String issuer,
long expirationMinutes
) {
}
/actuator/configprops can show the bound jwt properties.
Sensitive values may be sanitized.
Still, be careful exposing this endpoint.
32. /actuator/env
The env endpoint shows environment properties.
It can include values from:
application.yml
application-prod.yml
environment variables
system properties
command-line arguments
It helps debug:
Which property value is active?
Where did this property come from?
Did environment variable override YAML?
Security warning:
/envcan expose sensitive configuration, so do not expose it publicly.
33. /actuator/loggers
The loggers endpoint shows and can modify logging levels.
Example use:
Change de.klarsync logging from INFO to DEBUG temporarily.
This can help debug production issues without restarting the app.
Example conceptual request:
POST /actuator/loggers/de.klarsync
Content-Type: application/json
{
"configuredLevel": "DEBUG"
}
Be careful.
Changing logging levels in production can create large logs or expose sensitive data.
34. /actuator/mappings
The mappings endpoint shows request mappings.
It can help answer:
Which controller endpoints exist?
Which HTTP method maps to this path?
Why is my endpoint returning 404?
Which handler method receives the request?
Example:
GET /api/tasks -> TaskController.listTasks()
POST /api/tasks -> TaskController.createTask()
Useful for debugging Spring MVC routing.
35. /actuator/threaddump
The threaddump endpoint shows current JVM threads.
Useful for debugging:
deadlocks
blocked threads
slow requests
thread pool problems
high CPU issues
It is advanced but useful in production diagnostics.
Do not expose publicly.
36. /actuator/heapdump
The heapdump endpoint can create a heap dump.
Useful for debugging:
memory leaks
large object retention
high memory usage
But it is very sensitive because heap dumps can contain:
tokens
passwords
personal data
request data
business data
Memory sentence:
Never expose heapdump publicly.
37. /actuator/caches
The caches endpoint shows cache information.
Useful when using Spring Cache.
It can help answer:
Which caches exist?
Which cache manager is used?
Are cache names correct?
Example:
/actuator/caches
38. /actuator/scheduledtasks
The scheduledtasks endpoint shows scheduled tasks.
Useful when using:
@Scheduled
It helps answer:
Which scheduled jobs exist?
What cron expressions are configured?
Is my scheduled task registered?
39. Actuator and Security
Actuator endpoints can expose sensitive data.
Potentially sensitive endpoints:
env
beans
configprops
conditions
mappings
heapdump
threaddump
loggers
In production:
Expose only what you need.
Secure management endpoints.
Do not expose sensitive endpoints publicly.
Use firewall, private network, or Spring Security.
Memory sentence:
Actuator is powerful, so secure it.
40. Actuator with Spring Security
If Spring Security is on the classpath, Actuator endpoints can be protected.
Example idea:
@Configuration
public class ActuatorSecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http
.authorizeHttpRequests(auth -> auth
.requestMatchers(EndpointRequest.to("health")).permitAll()
.requestMatchers(EndpointRequest.toAnyEndpoint()).hasRole("ACTUATOR")
.anyRequest().authenticated()
)
.build();
}
}
Concept:
health can be public
other actuator endpoints require ACTUATOR role
normal app endpoints require normal app security rules
41. Common Production Exposure
A safer production setup:
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: when-authorized
This exposes useful monitoring endpoints but avoids exposing everything.
Exact setup depends on the company and infrastructure.
42. Actuator for Debugging Auto-Configuration
When something is wrong with auto-configuration:
Use:
/actuator/conditions
When a bean is missing or unexpected:
Use:
/actuator/beans
When properties are not binding:
Use:
/actuator/configprops
When environment values are confusing:
Use:
/actuator/env
Memory sentence:
Conditions, beans, configprops, and env are debugging endpoints.
43. Actuator for Your Klarsync-Like App
Useful endpoints:
/actuator/health
For load balancer and deployment health checks.
/actuator/metrics
For HTTP request duration, JVM memory, and system metrics.
/actuator/prometheus
If Prometheus/Grafana is used.
/actuator/info
For app version and build info.
/actuator/conditions
For debugging auto-configuration.
/actuator/beans
For debugging bean registration.
Do not publicly expose:
/actuator/env
/actuator/heapdump
/actuator/configprops
/actuator/beans
unless strongly secured.
44. Real Example: Minimal Actuator Setup
Gradle:
implementation("org.springframework.boot:spring-boot-starter-actuator")
YAML:
management:
endpoints:
web:
exposure:
include: health,info,metrics
Test:
curl http://localhost:8080/actuator/health
Expected:
{
"status": "UP"
}
45. Real Example: Debug Setup for Local Development
For local debugging:
management:
endpoints:
web:
exposure:
include: health,info,metrics,beans,conditions,configprops,env,mappings
endpoint:
health:
show-details: always
Use only locally or in a protected environment.
Do not expose this publicly.
46. Real Example: Production Setup
For production:
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: when-authorized
Possible additional security:
management port on private network
Spring Security role for actuator
firewall rules
VPN-only access
Kubernetes internal service
47. Actuator vs Logs
Logs answer:
What happened?
What error occurred?
What did the app do?
Actuator answers:
What is the current state of the app?
Is it healthy?
What beans exist?
What config is active?
What metrics are recorded?
Both are important.
Memory sentence:
Logs tell the story. Actuator shows the current state.
48. Actuator vs APM
Actuator provides built-in operational endpoints.
APM tools provide deeper monitoring.
Examples:
Datadog
New Relic
Grafana
Prometheus
Elastic APM
OpenTelemetry-based tools
Actuator often feeds data into these tools.
Example:
Actuator metrics -> Prometheus -> Grafana dashboard
49. Common Exam Traps
Trap 1
Actuator is not for business REST APIs.
It is for monitoring and management.
Trap 2
Adding Actuator dependency does not mean every endpoint is exposed publicly.
Endpoints must be exposed.
Trap 3
Current official docs expose only health over HTTP by default.
Do not assume all endpoints are exposed.
Trap 4
management.endpoints.web.exposure.include=* exposes all endpoints, but this can be dangerous.
Trap 5
In YAML, quote "*".
Correct:
include: "*"
Trap 6
/actuator/conditions helps debug auto-configuration.
Trap 7
/actuator/beans shows registered Spring beans.
Trap 8
/actuator/configprops shows configuration properties.
Trap 9
/actuator/env, /actuator/beans, /actuator/configprops, and /actuator/heapdump can expose sensitive data.
Trap 10
Health checks should be fast and safe.
50. Real Exam Question: Actuator
Question:
What is Spring Boot Actuator?
Answer:
Spring Boot Actuator provides production-ready monitoring and management features for Spring Boot applications. It exposes operational endpoints such as health, info, metrics, beans, conditions, and configprops.
51. Real Exam Question: Add Actuator
Question:
Which dependency adds Actuator?
Answer:
implementation("org.springframework.boot:spring-boot-starter-actuator")
or Maven equivalent:
<artifactId>spring-boot-starter-actuator</artifactId>
52. Real Exam Question: Health
Question:
What does /actuator/health show?
Answer:
It shows application health information, usually including a status such as UP, DOWN, OUT_OF_SERVICE, or UNKNOWN.
53. Real Exam Question: Metrics
Question:
What does /actuator/metrics show?
Answer:
It shows metrics collected by the application, such as JVM memory, HTTP request metrics, CPU usage, thread counts, and custom metrics.
54. Real Exam Question: Beans
Question:
What does /actuator/beans show?
Answer:
It shows the Spring beans registered in the application context, including bean names, types, dependencies, and sources.
55. Real Exam Question: Conditions
Question:
What does /actuator/conditions show?
Answer:
It shows auto-configuration condition evaluation, including which configurations matched or did not match and why.
56. Real Exam Question: ConfigProps
Question:
What does /actuator/configprops show?
Answer:
It shows @ConfigurationProperties beans and their bound properties, subject to sanitization.
57. Real Exam Question: Expose Endpoints
Question:
How can I expose health, info, and metrics over HTTP?
Answer:
management:
endpoints:
web:
exposure:
include: health,info,metrics
58. Real Exam Question: Expose All
Question:
How can I expose all Actuator endpoints over HTTP?
Answer:
management:
endpoints:
web:
exposure:
include: "*"
But this should be avoided in public production environments unless endpoints are properly secured.
59. Real Exam Question: Health Details
Question:
How can I show health details?
Answer:
management:
endpoint:
health:
show-details: always
Safer production option:
management:
endpoint:
health:
show-details: when-authorized
60. Real Exam Question: Security
Question:
Why should Actuator endpoints be secured?
Answer:
Some Actuator endpoints can reveal sensitive information such as environment properties, bean names, configuration properties, request mappings, thread dumps, or heap dumps. They should not be publicly exposed without security.
61. Interview Answer
Question:
What is Spring Boot Actuator?
Good answer:
Spring Boot Actuator provides production-ready monitoring and management features for Spring Boot applications. It exposes operational endpoints such as health, info, metrics, beans, conditions, and configprops. These endpoints help developers and operations teams understand the state of a running application, debug configuration issues, and integrate with monitoring tools.
62. Interview Answer
Question:
Which Actuator endpoints do you commonly use?
Good answer:
I commonly use /actuator/health for health checks, /actuator/info for application metadata, /actuator/metrics for runtime metrics, /actuator/conditions for auto-configuration debugging, /actuator/beans for checking registered beans, and /actuator/configprops for checking bound configuration properties. In production, I expose only the endpoints I need and secure sensitive ones.
63. Interview Answer
Question:
How do you debug auto-configuration with Actuator?
Good answer:
I use /actuator/conditions to see which auto-configurations matched or did not match and why. I use /actuator/beans to check which beans are actually registered. I use /actuator/configprops to inspect bound configuration properties and /actuator/env to understand active property values. These endpoints help me debug without guessing.
64. Interview Answer
Question:
How do you secure Actuator in production?
Good answer:
I expose only the endpoints that are needed, such as health, info, metrics, or prometheus. I avoid exposing sensitive endpoints like env, beans, heapdump, and configprops publicly. I can place Actuator on a separate management port, restrict access with firewall or private network rules, and protect endpoints with Spring Security roles.
65. Interview Answer
Question:
What is the difference between health and metrics?
Good answer:
The health endpoint gives a high-level status of whether the application and its dependencies are healthy, such as UP or DOWN. Metrics provide numerical measurements over time, such as request count, request duration, memory usage, CPU usage, and custom business counters. Health is usually used for availability checks, while metrics are used for monitoring trends and performance.
66. Tiny Code Practice
Add Actuator:
implementation("org.springframework.boot:spring-boot-starter-actuator")
Expose endpoints locally:
management:
endpoints:
web:
exposure:
include: health,info,metrics,conditions,beans,configprops
Run:
curl http://localhost:8080/actuator/health
curl http://localhost:8080/actuator/conditions
curl http://localhost:8080/actuator/beans
Questions:
- Which endpoint checks health?
- Which endpoint helps debug auto-configuration?
- Which endpoint shows beans?
- Should this full exposure be used publicly in production?
Answers:
/actuator/health/actuator/conditions/actuator/beans- No. It should only be used locally or in a secured environment.
67. Tiny Bug Practice 1
Problem:
You added Actuator, but /actuator/beans returns 404.
Question:
What is the likely reason?
Answer:
The endpoint is probably not exposed over HTTP.
Fix:
management:
endpoints:
web:
exposure:
include: beans
Or expose multiple endpoints:
management:
endpoints:
web:
exposure:
include: health,info,beans
68. Tiny Bug Practice 2
Problem:
You expose:
management:
endpoints:
web:
exposure:
include: *
YAML fails or behaves unexpectedly.
Question:
What is wrong?
Answer:
In YAML, * has special meaning. Quote it:
management:
endpoints:
web:
exposure:
include: "*"
69. Tiny Bug Practice 3
Problem:
/actuator/health is slow.
Question:
What should I check?
Answer:
Check custom health indicators and external dependency checks. Health indicators should be fast and safe. Avoid slow external calls, heavy database queries, or operations that can hang.
Practice Questions and Answers
Question 1
What is Spring Boot Actuator?
Answer:
Spring Boot Actuator provides production-ready monitoring and management features for Spring Boot applications.
Question 2
Why do we need Actuator?
Answer:
Actuator helps monitor and understand a running application. It can show health, metrics, beans, configuration properties, auto-configuration conditions, environment properties, mappings, and more.
Question 3
Which dependency adds Actuator?
Answer:
Use:
implementation("org.springframework.boot:spring-boot-starter-actuator")
Question 4
What is an Actuator endpoint?
Answer:
An Actuator endpoint is an operational endpoint that exposes monitoring or management information about the application.
Question 5
What is the default Actuator base path?
Answer:
The default Actuator base path is:
/actuator
Question 6
What does /actuator/health show?
Answer:
/actuator/health shows application health information such as UP, DOWN, OUT_OF_SERVICE, or UNKNOWN.
Question 7
What does /actuator/info show?
Answer:
/actuator/info shows application metadata such as name, version, build information, or custom info.
Question 8
What does /actuator/metrics show?
Answer:
/actuator/metrics shows runtime metrics such as JVM memory, HTTP request metrics, CPU usage, thread counts, and custom metrics.
Question 9
What does /actuator/beans show?
Answer:
/actuator/beans shows Spring beans registered in the application context.
Question 10
What does /actuator/conditions show?
Answer:
/actuator/conditions shows which auto-configurations matched or did not match and why.
Question 11
What does /actuator/configprops show?
Answer:
/actuator/configprops shows @ConfigurationProperties beans and their bound values, subject to sanitization.
Question 12
What is the difference between enabled and exposed?
Answer:
Enabled means an endpoint exists in the application. Exposed means it can be accessed remotely, for example over HTTP.
Question 13
How can I expose health, info, and metrics?
Answer:
Use:
management:
endpoints:
web:
exposure:
include: health,info,metrics
Question 14
How can I expose all endpoints in YAML?
Answer:
Use:
management:
endpoints:
web:
exposure:
include: "*"
Question 15
Why should "*" be quoted in YAML?
Answer:
* has special meaning in YAML, so it should be quoted when used as a literal value.
Question 16
Why should Actuator endpoints be secured?
Answer:
Actuator endpoints should be secured because some endpoints can reveal sensitive information such as environment properties, bean names, config properties, mappings, thread dumps, or heap dumps.
Question 17
What is a HealthIndicator?
Answer:
A HealthIndicator is a component that contributes health information for part of the system, such as a database, disk space, or external API.
Question 18
What is Micrometer?
Answer:
Micrometer is the metrics instrumentation library used by Spring Boot to collect and export metrics.
Question 19
What is the difference between health and metrics?
Answer:
Health gives a high-level status such as UP or DOWN. Metrics provide numerical measurements such as memory usage, request count, request duration, and custom counters.
Question 20
Which endpoints are useful for debugging auto-configuration and bean registration?
Answer:
Useful endpoints are:
/actuator/conditions
/actuator/beans
/actuator/configprops
/actuator/env
Final Memory Sentences
- Actuator provides production-ready monitoring and management features.
- Actuator endpoints expose operational information.
- The default base path is
/actuator. /actuator/healthshows application health./actuator/infoshows application metadata./actuator/metricsshows runtime metrics./actuator/beansshows Spring beans./actuator/conditionsshows auto-configuration decisions./actuator/configpropsshows configuration properties.- Enabled means the endpoint exists.
- Exposed means the endpoint can be accessed remotely.
- Use
management.endpoints.web.exposure.includeto expose endpoints. - Quote
"*"in YAML. - Do not expose sensitive endpoints publicly.
- Health checks should be fast and safe.
- Micrometer is used for metrics.
- Actuator is useful for debugging and production monitoring.