Reputation: 17
Good morning all,
Hopefully this is a really simple question.
How are spring-boot-actuator endpoints supported?
I can see the @ReadOperation and @WriteOperation for most of them, but I don't see where the base URL is supported or what technologies support the creation of the 'http://localhost:8080/actuator' endpoint.
My project does show the JSON (I guess that's what that is?) when I navigate to the address 'http://localhost:8080/actuator' instead of showing a 404 or 500.
I would like to understand the underlying architecture of the spring-boot-actuator project. The 'http://localhost:8080/actuator' URL is active, returns, and shows data.
This URL does not seem to be annotated with:
@ResponseBody
@RequestMapping
@GetMapping
@ReadOperation
The 'http://localhost:8080/actuator' doesn't seem to be supported in the micrometer project.
I'm very confused as to how the actuator programming works.
Thanks for everyone's help.
Upvotes: 1
Views: 131
Reputation: 1397
The root actuator endpoint (default: /actuator) which you are referring to, is indeed annotated with @ResponseBody
. You can check it out here: https://github.com/spring-projects/spring-boot/blob/0a4c26532dff6f3fa1bf6d2e1c2a74549191117a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java#L76
Upvotes: 1