actuatorÊÚȨÐèÒªÓöÈ
·ñ£¬actuatorÊÚȨ²»ÐèÒªÓöȡ£ËüÊÇÒ»¸öÄÚÖÃÓÚspring bootµÄ¿ò¼Ü£¬ÎÞÐèÌØÊâÊÚȨ¡£
actuatorÊÚȨÐèÒªÓöÈÂð£¿
·ñ¡£
ÏêϸڹÊÍ£º
ActuatorÊÇÒ»¸öSpring BootÌṩµÄ¿ò¼Ü£¬ÓÃÓÚΪSpringÓ¦ÓóÌÐòÌṩ¼à¿ØºÍÖÎÀíÐÅÏ¢¡£ËüÄÚÖÃÓÚSpring Boot£¬²»ÐèÒªÌØÁíÍâÊÚȨÓöȡ£×¢²á»òʹÓÃActuator²»ÐèÒªÈκÎÀàÐ͵ÄÔÊÐí»ò¶©ÔÄ¡£
ActuatorÔÚĬÈÏÇéÐÎÏ´¦ÓÚ½ûÓÃ״̬¡£ÒªÆôÓÃËü£¬ÄúÐèÒªÔÚÓ¦ÓóÌÐòµÄapplication.properties»òapplication.ymlÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
management.endpoints.web.exposure.include=*
µÇ¼ºó¸´ÖÆ
Õ⽫ÆôÓÃËùÓÐActuator¶Ëµã²¢ÔÊÐíͨ¹ýWebÇëÇó»á¼ûËüÃÇ¡£Äú¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐʹÓÃ/actuator¶Ëµã»á¼ûÕâЩ¶Ëµã£¬ÀýÈ磺
- /actuator/info£ºÏÔʾӦÓóÌÐòÐÅÏ¢
- /actuator/health£º¼ì²éÓ¦ÓóÌÐò¿µ½¡×´Ì¬
- /actuator/metrics£ºÏÔʾӦÓóÌÐòÖ¸±ê
Actuator»¹ÌṩÁËÉèÖÃÑ¡ÏîÀ´ÏÞÖƶÔijЩ¶ËµãµÄ»á¼û¡£ÈôÊÇÄúÐèÒªÌØÁíÍâÇå¾²²½·¥£¬¿ÉÒÔʹÓÃmanagement.endpoints.web.exposure.includeºÍmanagement.endpoints.web.exposure.excludeÉèÖÃÀ´¿ØÖÆÌض¨¶ËµãµÄ»á¼ûȨÏÞ¡£
ÖµµÃ×¢ÖصÄÊÇ£¬ËäÈ»Actuator×Ô¼º²»ÐèÒªÊÚȨÓöȣ¬µ«ÈôÊÇÄúÐèҪʹÓÃActuatorÓëÆäËûÉÌÒµÈí¼þ»òЧÀͼ¯³É£¬Ôò¿ÉÄÜÐèÒªÖ§¸¶ÌØÁíÍâÓöȡ£ÀýÈ磬ÈôÊÇÄúÏëʹÓÃActuatorÓëµÚÈý·½¼à¿Øƽ̨¼¯³É£¬¸Ãƽ̨¿ÉÄÜÐèÒª¸¶·Ñ¶©ÔÄ¡£
ÒÔÉϾÍÊÇactuatorÊÚȨÐèÒªÓöȵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡