Skip to content

Instantly share code, notes, and snippets.

@pl99
Last active August 20, 2018 13:56
Show Gist options
  • Save pl99/f12d585ad5fb65840ec9567b27dde2de to your computer and use it in GitHub Desktop.
Save pl99/f12d585ad5fb65840ec9567b27dde2de to your computer and use it in GitHub Desktop.
spring boot actuator endpoints for applications control
#Полный перечень эндпойнтов, к которым можно получить доступ, аналогично management.endpoints.web.exposure.include=*
#management.endpoints.web.exposure.include=["archaius",\
# "auditevents","beans","health","conditions","shutdown",\
# "configprops","env","env/{toMatch}","info","loggers","loggers/{name}",\
# "heapdump","threaddump","metrics/{requiredMetricName}","metrics",\
# "scheduledtasks","httptrace","mappings","refresh","restart","pause","resume",\
# "features","service-registry","routes","routes/{format}","filters","hystrix.stream"]
# Работает именно так:
management.endpoints.web.exposure.include=health,info,metrics,shutdown,refresh,restart,routes,hystrix.stream,scheduledtasks,configprops
#Позволяет остановить сервис
management.endpoint.shutdown.enabled=true
# Если доступен .../actuator/shutdown, то можно остановить приложение примерно так
# curl -X POST localhost:8889/actuator/shutdown
# Можно рестартовать
management.endpoint.restart.enabled=true
# Если доступен .../actuator/restart, то можно рестартовать приложение примерно так
# curl -X POST localhost:8889/actuator/restart
# Обновить сервис.
# Пока может работать и без этой строчки, по умолчанию true, но рестарт тоже true, судя по документации, однако без строки выше не работает
management.endpoint.refresh.enabled=true
#Если доступен endpoint actuator/refresh,
# то обращение вида: curl -X POST localhost:8889/actuator/refresh
# позволяет в приложении получить новые значения свойств в файлах конфигураций
# см. https://gist.github.com/pl99/ba608b786e0223eb9ae6228ec5aa32ef
#Показывает дополнительные данные, иначе только статус - {"status":"UP"}
management.endpoint.health.show-details=always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment