Spring Actuator Maven Dependency Configuration |Video upload date:  · Duration: PT2M25S  · Language: EN

Learn how to add Spring Boot Actuator with Maven and enable endpoints and metrics for simple monitoring and observability.

If you want your Spring Boot app to stop being the mysterious black box it currently is add Actuator with Maven and hook up Micrometer for real metrics. This short guide explains the dependency, the tiny config changes, and the quick tests so you can sleep at night knowing your endpoints actually respond.

Why add Actuator to your Spring Boot app

Actuator gives you ready made operational endpoints like health, info, metrics and more. It saves you from writing bespoke status endpoints at 2 a.m and then regretting everything. Pair it with Micrometer and you get a clean path to Prometheus or other monitoring backends for proper metrics and dashboards.

Step 1 Add the Actuator dependency to pom.xml

Drop the starter in and let Spring Boot wire the beans. Maven takes care of the rest. No rituals required besides editing your pom and hitting build.

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Step 2 Expose the endpoints in application properties

Control what is visible over HTTP and what stays backstage. Running the management server on a separate port reduces the chance that a user accidentally pokes an operational endpoint for entertainment.

management.endpoints.web.exposure.include=health,info,metrics
management.server.port=8081
# disable remote shutdown unless you like chaos
management.endpoint.shutdown.enabled=false

Step 3 Add a Micrometer registry when exporting metrics

If you plan to ship metrics to Prometheus or another backend add the appropriate Micrometer registry dependency. Micrometer translates Spring metrics into the format your backend expects.

<dependency>
  <groupId>io.micrometer</groupId>
  <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

Step 4 Build run and verify

Package and run the app like you always do then hit the management endpoints to make sure the wiring actually works. A single curl proves everything without a full observability pipeline installed.

mvn package
java -jar target/your-app.jar
# or from the IDE
mvn spring-boot:run

# quick checks
curl -s http://localhost:8081/actuator/health
curl -s http://localhost:8081/actuator/metrics

Production tips and checklist

  • Expose only health and metrics over the network in production. Less is safer and less boring.
  • Keep sensitive endpoints restricted to local or secure networks or put them behind auth.
  • Use a dedicated management port to avoid accidental exposure to user traffic.
  • When exporting metrics pick the right Micrometer registry for your backend and test end to end.

Quick checklist before you call it done

  1. Actuator starter in pom.xml
  2. Desired endpoints listed in management.endpoints.web.exposure.include
  3. Management port set if needed
  4. Micrometer registry added for metric export
  5. Endpoints verified with curl or a browser

That is all it takes to get basic monitoring up and running with Spring Boot Actuator and Micrometer. You get low overhead, useful metrics and a set of endpoints that tell you if the app is alive or pretending to be alive. Now go configure it properly and try not to expose everything to the internet.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.