Implementing Spring Boot actuators is not very difficult. In this post I’ll show what you can get for free, without adding any code.

First of all, you need this dependency in your pom.xml:


This will expose the /health and /info endpoints by default, as mentioned in the documentation. Both endpoints will be under /actuator (so the full path is /actuator/health).

Health endpoint

The health endpoint will give back this JSON:

{ "status": "UP" }

which tells us that the service is up and running.

Info endpoint

The info endpoint does not return any information by default. We can change that and use the endpoint to see the state of the git repository at the time of the build.

In pom.xml, add the following build plugin:


and in, add this line:

Now, the info endpoint will offer information about the state of the git repository at the time the project was built.


  "git": {
    "build": {
      "host": "6b7e5600-3108-4330-a08a-5a7eff38002d",
      "version": "1.0.0",
      "time": "2018-07-06T09:59:47Z",
      "user": {
        "name": "",
        "email": ""
    "branch": "master",
    "commit": {
      "message": {
        "short": "Merged in MON-448 (pull request #3)",
        "full": "Merged in MON-448 (pull request #3)\n\nMON-448 Changed auth service to return ExpiresIn for the access token."
      "id": {
        "describe": "df38293",
        "abbrev": "df38293",
        "describe-short": "df38293",
        "full": "df382933d0e2f8cb390cfe9f2e87e6a9046b661d"
      "time": "2018-07-06T09:59:07Z",
      "user": {
        "email": "",
        "name": "John Doe"
    "closest": {
      "tag": {
        "name": "",
        "commit": {
          "count": ""
    "dirty": "false",
    "remote": {
      "origin": {
        "url": ""
    "tags": ""

Adding more endpoints

There are more endpoints available, but not exposed by default. As an example, let’s enable the metrics endpoint. We need this in


This will enable the metrics endpoint but also expose it through the web.

Alternatively, we can expose all endpoints to the web, but control which ones are enabled:


Metrics endpoint

In any case, visiting the endpoint at /actuators/metrics give us a list of available metrics:

  "names": [

And to see for example the uptime (process.uptime metric) we need to visit /actuator/metrics/process.uptime:

  "name": "process.uptime",
  "measurements": [
      "statistic": "VALUE",
      "value": 72704.929
  "availableTags": []


Some endpoints might reveal sensitive information that can potentially be exploited by an attacker. If Spring Security is used, the actuators are protected by default.

You can bypass Spring Security for the actuators that you feel comfortable that they do not expose anything exploitable. You’ll need this kind of configuration:

public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    private static final String[] AUTH_WHITELIST = {
        // other public endpoints of your API may be appended to this array

    protected void configure(HttpSecurity http) throws Exception {
        // allow all whitelisted resources


It’s easy to get started with Spring Boot actuators, without even writing any code. You can already use these endpoints in monitoring tools, but also extend them with custom solutions.