What is an actuator?
It is app monitoring tool for health check applications user some endpoint urls.
Monitoring our app, gathering metrics, understanding traffic or the state of our database
becomes trivial with this dependency.
becomes trivial with this dependency.
The main benefit of this library is that we can get production grade tools without having to actually implement these features ourselves.
Actuator is mainly used to expose operational information about the running application –
health, metrics, info, dump, env, etc. It uses HTTP endpoints or JMX beans to enable us to
interact with it.
health, metrics, info, dump, env, etc. It uses HTTP endpoints or JMX beans to enable us to
interact with it.
Once this dependency is on the classpath several endpoints are available for us out of the box.
As with most Spring modules, we can easily configure or extend it in many ways.
As with most Spring modules, we can easily configure or extend it in many ways.
Problem
- How can I monitor and manage my application?
- How can I check the application's health?
- How can I access application metrics?
Solution: Spring Boot Actuator
- Exposes endpoints to monitor and manage your application
- You easily get DevOps functionality out-of-the-box
- Simply add the dependency to your POM file
- REST endpoints are automatically added to your application
Spring Boot Actuator
Adding the dependency to your POM file
Endpoints are prefixed with: /actuator
If your application is a web application (Spring MVC, Spring WebFlux, or Jersey), you can use
the following additional endpoints:
the following additional endpoints:
Exposing Endpoints
- By default, only /health and /info are exposed
- To expose all actuator endpoints over HTTP
Spring Boot Actuator - Security
What about Security?
You may NOT want to expose all of this information
You may NOT want to expose all of this information
• Add Spring Security to project and endpoints are secured :-)
Customizing Spring Security
- You can customize Spring Security for Spring Boot Actuator
- Use a database for roles, encrypted passwords etc
Follow the same techniques as regular Spring Security
Excluding Endpoints
- To exclude /health and /info
Comments
Post a Comment