本博文在[Spring Boot] Hello Spring LDAP 基础上稍作修改,尝试一下监控和管理Spring Boot应用。
application.properties改动
server.context-path=/HelloSpringLdapOdm
server.port=8080
spring.profiles.active=test,dev
# spring.dao.exceptiontranslation.enabled=false
yqu.ldap.url=ldap://127.0.0.1:18880
yqu.ldap.userDN=uid=admin,ou=system
yqu.ldap.password=secret
yqu.ldap.base=dc=jayway,dc=se
yqu.ldap.clean=true
management.port=8081
management.address=127.0.0.1
endpoints.shutdown.enabled=true
applicationDefaultJvmArgs: [
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=55558"
]
测试
- autoconfig: Displays an auto-configuration report showing allauto-configuration candidates and the reason why they ‘were’ or‘were not’ applied.
- beans: Displays a complete list of all the Spring beans in yourapplication.
- configprops: Displays a collated list of all@ConfigurationProperties.
- dump: Performs a thread dump.
- env: Exposes properties from Spring’sConfigurableEnvironment.
- health: Shows application health information (when theapplication is secure, a simple ‘status’ when accessed over anunauthenticated connection or full message details whenauthenticated).
- info: Displays arbitrary application info.
- mappings: Displays a collated list of all @RequestMappingpaths.
- metrics: Shows ‘metrics’ information for the currentapplication.
- trace: Displays trace information (by default the last few HTTPrequests).
- shutdown: Allows the application to be gracefully shutdown (notenabled by default).
参考
Spring Boot: Monitoring and management over HTTP
Spring Boot Actuator:Production-ready features