1.pom file
<?XML version= "1.0" encoding= "UTF-8"?><Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupId>Com.zy</groupId> <Artifactid>Spring-boot-monitor-demo</Artifactid> <version>0.0.1-snapshot</version> <Packaging>Jar</Packaging> <name>Spring-boot-monitor-demo</name> <Description>Demo Project for Spring Boot</Description> <Parent> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-parent</Artifactid> <version>2.0.4.RELEASE</version> <RelativePath/> <!--Lookup parent from repository - </Parent> <Properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </Properties> <Dependencies> <!--Endpoint Supervision Endpoint Actuator - <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-actuator</Artifactid> </Dependency> <!--Web - <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-web</Artifactid> </Dependency> <!--Hot Deployment - <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-devtools</Artifactid> <Scope>Runtime</Scope> </Dependency> <Dependency> <groupId>Org.projectlombok</groupId> <Artifactid>Lombok</Artifactid> <Optional>True</Optional> </Dependency> <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-test</Artifactid> <Scope>Test</Scope> </Dependency> </Dependencies> <Build> <Plugins> <plugin> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-maven-plugin</Artifactid> </plugin> </Plugins> </Build></Project>
2.APPLICATION.YML file
Management
Security
EnabledFalse
Info
App
Id:hello
version:1.0.0
# When set to true, support remote Shutdown service: only need to send POST request, suffix is shutdown, such as:
# Localhost:8080/shutdown
Endpoints:
shutdown:
Enabled: true
# Close all endpoints
Span style= "color: #cc7832; Font-weight:bold ">enabled: false
# leave only one endpoint
beans:
enabled: true
# custom endpoint ID or access path
# beans:
# id:mybean
3. Endpoint-related information
Springboot Endpoint Supervision Endpoint Actuator