Accessing localhost:8080/actuator endpoint (with spring boot actuator)

冷暖自知 提交于 2019-12-12 04:46:14

问题


In spring docs I have read about endpoint named "actuator" which is provided by actuator dependency, but I haven't managed to access it on my local testing app.

Question: Does someone know how to access that endpoint? of coarse if it is possible :)
Sub-question 1: If this endpoint exists, then why it is hidden?
Sub-question 2: If this endpoint doesn't exist, how can we notify spring.io to correct documentation page (open some kind of ticket) ?

Details:

  • I want to access exactly "actuator" endpoint, not other endpoints provided by spring boot actuator (localhost:8080/actuator)
  • Yes, I have tried to enable that endpoint manually in properties file (endpoints.enabled=true OR endpoints.actuator.enabled=true)
  • Yes, I have tried to enable/disable endpoints.sencitive property
  • Yes, other endpoints of actuator work just fine
  • No special reason why I need that, just want to try it out (just learning new stuff :) )
  • Please don't just answer "there is no such endpoint dude!", there should be some kind of reason why it is written in the docs
  • Please use spring boot version which I am using now before answering "it is working for me with these configs" (spring boot version: 1.5.4.RELEASE)
  • Thank you in advance :)

回答1:


You must include the Spring Hateoas dependency in order for the /actuator endpoint to become available:

<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
</dependency>

Per the docs:

Provides a hypermedia-based “discovery page” for the other endpoints. Requires Spring HATEOAS to be on the classpath.



来源:https://stackoverflow.com/questions/45289481/accessing-localhost8080-actuator-endpoint-with-spring-boot-actuator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!