liveBook · Manning

Base path

As explained in Spring in Action, Sixth Edition

The Actuator base path is the URL path under which Spring Boot Actuator endpoints are exposed.

The Actuator base path is the URL prefix placed before Spring Boot Actuator’s HTTP endpoints. By default, endpoints use /actuator, so application health is available at /actuator/health. section 15.1.1

Changing the prefix gives Actuator endpoints a different URL namespace. Set management.endpoints.web.base-path to /management, then request application health at /management/health. section 15.1.1

Move Actuator under /management

Configure application.yml with management.endpoints.web.base-path: /management. A GET request to /management/health then retrieves health information instead of using /actuator/health. section 15.1.1

$ curl localhost:8080/actuator
{
  "_links": {
    "self": {
      "href": "http://localhost:8080/actuator",
      "templated": false
    },
    "auditevents": {
      "href": "http://localhost:8080/actuator/auditevents",
      "templated": false
    },
    "beans": {
      "href": "http://localhost:8080/actuator/beans",
      "templated": false
    },
    "health": {
      "href": "http://localhost:8080/actuator/health",
      "templated": false
    },
    ...
  }
}

Requesting the base path returns HATEOAS links that map the available Actuator endpoints, including health and info. section 15.2

Endpoint availability can vary because libraries may add endpoints and some endpoints may not be exported. The base-path links therefore provide a practical map of what the running application exposes. section 15.2

How Spring in Action, Sixth Edition covers it

How deep it goes
Defines the default and configurable prefixes with request examples, but does not detail endpoint exposure or security configuration.
Examples
Uses /actuator/health by default, /management/health after configuration, and curl localhost:8080/actuator for endpoint discovery.
What it assumes
Assumes a running Spring Boot application with Actuator HTTP endpoints and basic familiarity with GET requests.
What you can do after
Operate/configure Actuator by changing its URL prefix and discovering available endpoints from the base-path response.
How it connects
Connects Actuator base paths with HTTP endpoints, health information, info endpoints, HATEOAS links, and endpoint exposure.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.