{"id":8253,"date":"2023-11-28T20:20:29","date_gmt":"2023-11-28T12:20:29","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=8253"},"modified":"2023-12-06T10:14:17","modified_gmt":"2023-12-06T02:14:17","slug":"springboot-zhong-shen-me-shispring-actuator-ta-you","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/11\/28\/springboot-zhong-shen-me-shispring-actuator-ta-you\/","title":{"rendered":"SpringBoot\u4e2d\u4ec0\u4e48\u662fSpring Actuator?\u5b83\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f"},"content":{"rendered":"<p>Spring Boot Actuator\u662fSpring Boot\u63d0\u4f9b\u7684\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u6a21\u5757\uff0c\u7528\u4e8e\u76d1\u63a7\u548c\u7ba1\u7406Spring Boot\u5e94\u7528\u7a0b\u5e8f\u3002Actuator\u63d0\u4f9b\u4e86\u8bb8\u591a\u5185\u5efa\u7684\u3001\u53ef\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u7684\u7279\u6027\uff0c\u5305\u62ec\u5e94\u7528\u7a0b\u5e8f\u7684\u5065\u5eb7\u72b6\u51b5\u68c0\u67e5\u3001\u5ea6\u91cf\u4fe1\u606f\u3001\u73af\u5883\u5c5e\u6027\u3001\u914d\u7f6e\u4fe1\u606f\u3001\u65e5\u5fd7\u548c\u7ebf\u7a0b\u8f6c\u50a8\u7b49\u3002\u5b83\u4f7f\u5f97\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u66f4\u5bb9\u6613\u76d1\u63a7\u548c\u7ba1\u7406Spring Boot\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u4e00\u4e9bSpring Boot Actuator\u7684\u4e3b\u8981\u529f\u80fd\u548c\u4f18\u52bf\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>\n<strong>\u5065\u5eb7\u68c0\u67e5\uff08Health Check\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/health<\/code>\u7aef\u70b9\u63d0\u4f9b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u5065\u5eb7\u72b6\u51b5\u68c0\u67e5\u3002\u5065\u5eb7\u68c0\u67e5\u80fd\u591f\u544a\u8bc9\u4f60\u5e94\u7528\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u5305\u62ec\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u3001\u662f\u5426\u6709\u4efb\u4f55\u9519\u8bef\u6216\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5ea6\u91cf\u4fe1\u606f\uff08Metrics\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/metrics<\/code>\u7aef\u70b9\u63d0\u4f9b\u4e86\u5173\u4e8e\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u65f6\u6027\u80fd\u6307\u6807\u7684\u8be6\u7ec6\u5ea6\u91cf\u4fe1\u606f\u3002\u8fd9\u4e9b\u6307\u6807\u5305\u62ec\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u5783\u573e\u56de\u6536\u7edf\u8ba1\u3001\u7ebf\u7a0b\u4f7f\u7528\u60c5\u51b5\u7b49\uff0c\u6709\u52a9\u4e8e\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u73af\u5883\u5c5e\u6027\uff08Environment Properties\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/env<\/code>\u7aef\u70b9\u63d0\u4f9b\u4e86\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u73af\u5883\u5c5e\u6027\u4fe1\u606f\u3002\u8fd9\u5305\u62ec\u4e86\u6240\u6709\u7684\u914d\u7f6e\u5c5e\u6027\uff0c\u5982\u7cfb\u7edf\u5c5e\u6027\u3001\u73af\u5883\u53d8\u91cf\u3001\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u5c5e\u6027\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u914d\u7f6e\u4fe1\u606f\uff08Configuration Properties\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/configprops<\/code>\u7aef\u70b9\u63d0\u4f9b\u4e86\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6240\u6709\u914d\u7f6e\u5c5e\u6027\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u5176\u6765\u6e90\u3001\u9ed8\u8ba4\u503c\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u65e5\u5fd7\uff08Logging\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/loggers<\/code>\u7aef\u70b9\u5141\u8bb8\u4f60\u52a8\u6001\u5730\u4fee\u6539\u5e94\u7528\u7a0b\u5e8f\u7684\u65e5\u5fd7\u7ea7\u522b\uff0c\u800c\u65e0\u9700\u91cd\u65b0\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u5bf9\u4e8e\u5b9e\u65f6\u76d1\u63a7\u548c\u8c03\u6574\u65e5\u5fd7\u7ea7\u522b\u975e\u5e38\u6709\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7ebf\u7a0b\u8f6c\u50a8\uff08Thread Dump\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u901a\u8fc7<code>\/actuator\/threaddump<\/code>\u7aef\u70b9\u63d0\u4f9b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u7ebf\u7a0b\u8f6c\u50a8\uff0c\u7528\u4e8e\u8bca\u65ad\u548c\u5206\u6790\u7ebf\u7a0b\u7684\u72b6\u6001\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u81ea\u5b9a\u4e49\u7aef\u70b9\uff08Custom Endpoints\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u5141\u8bb8\u5f00\u53d1\u8005\u521b\u5efa\u81ea\u5b9a\u4e49\u7684\u7aef\u70b9\uff0c\u901a\u8fc7\u5b9e\u73b0<code>Endpoint<\/code>\u63a5\u53e3\u6765\u66b4\u9732\u81ea\u5b9a\u4e49\u7684\u7ba1\u7406\u7aef\u70b9\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u6839\u636e\u7279\u5b9a\u7684\u9700\u6c42\u6dfb\u52a0\u81ea\u5b9a\u4e49\u7684\u76d1\u63a7\u548c\u7ba1\u7406\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5b89\u5168\u6027\uff1a<\/strong><\/p>\n<ul>\n<li>Actuator\u63d0\u4f9b\u4e86\u4e00\u5b9a\u7a0b\u5ea6\u7684\u5b89\u5168\u6027\u4fdd\u62a4\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6765\u9650\u5236\u654f\u611f\u7aef\u70b9\u7684\u8bbf\u95ee\uff0c\u786e\u4fdd\u53ea\u6709\u6388\u6743\u7528\u6237\u80fd\u591f\u8bbf\u95ee\u5173\u952e\u7684\u76d1\u63a7\u548c\u7ba1\u7406\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u603b\u4f53\u800c\u8a00\uff0cSpring Boot Actuator\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\u96c6\uff0c\u7528\u4e8e\u76d1\u63a7\u548c\u7ba1\u7406Spring Boot\u5e94\u7528\u7a0b\u5e8f\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u53ef\u89c2\u5bdf\u6027\u3001\u8bca\u65ad\u6027\u548c\u53ef\u7ba1\u7406\u6027\u3002\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0cActuator\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u4ef7\u503c\u7684\u5de5\u5177\uff0c\u80fd\u591f\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u7ef4\u62a4\u4ed6\u4eec\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot Actuator\u662fSpring Boot\u63d0\u4f9b\u7684\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u6a21\u5757\uff0c\u7528\u4e8e\u76d1\u63a7\u548c\u7ba1\u7406Spr [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-8253","post","type-post","status-publish","format-standard","hentry","category-springboot"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=8253"}],"version-history":[{"count":2,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8253\/revisions"}],"predecessor-version":[{"id":16592,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8253\/revisions\/16592"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=8253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=8253"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=8253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}