Procedure for monitoring management

By importing spring-boot-starter-actuator, the SpringBoot provides application monitoring and management. You can perform operations over HTTP,JMX, and SSH to automatically obtain audit, health, and indicator information

  • Introducing spring – the boot – starter – physical
  • Access the monitoring endpoint through HTTP
  • Shutdown,POST, and this endpoint is off by default
1. Create a SpringBoot project, and import the Web package, DevTools package (hot deployment), and EXOskeleton-2 package in Ops. Configuration file management. Security. Enabled = falseCopy the code

Monitor and manage endpoints

Endpoint names describe
autoconfig All automatic configuration information
auditevents Audit information
beans Information about all beans
configprops All configuration properties
dump Thread status information
env Current Environment information
health Application health
info Current Application Information
metrics Indicators of application
mappings Apply @requestMapping to the mapping path
shutdown Close the current application (default)
trace Tracking information (latest HTTP requests)
# Customize endpoint information
  • Custom endpoint passEndpoints + endpoint name + attribute nameSet up the
    • Modify endpoint ID: endpoints.beans.id=mybeans
    • Open the remote application close function: endpoints. Shutdown. The enable = true
    • To disable endpoints: endpoints.beans.enabled=false
    • Enable the desired endpoint:
      • Endpoints. Enabled =false(Disable all endpoint access)
      • endpoints.beans.enabled=true
    • Customizing endpoint access paths:
      • Manage.context-path =/manage(customize access paths for all endpoints)
      • endpoints.beans.path=/bean
      • Custom endpoint port number: management. Port =8989
    • Close the HTTP endpoint: management.port=-1

The health endpoint

  • Check the health of the connected application configuration **(status=”up”/status=” Down “)**
  • Custom health indicator:
    • Create a pointer class that implements the HealthIndicator interface: health.up ().build() for Health, health.down ().withdetail (” MSG “,” XXX “).build() for Health
    • Indicator name format :xxxHealthIndicator
    • The @Component annotation adds indicators to the container