zoukankan      html  css  js  c++  java
  • Spring-boot内置的程序管理监控工具-Actuator

    1.引入jar包:

    <dependencies>
    	<dependency>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-starter-actuator</artifactId>
    	</dependency>
    </dependencies>

    2.打开配置开关:
    actuator 提供了 jmx http 两种对外接口,以http为例。
    management.endpoints.web.exposure.include=*
    management.endpoints.web.exposure.exclude=env,beans

    3.打开浏览器,输入 http://localhost:8888/actuator
    该接口提供了所有actuator 接口列表:
    上面各个接口作用是什么,可以对着官方文档去查找:

    
    
    4.重点接口讲解
    http://localhost:8888/actuator/heapdump  可以dump出当前jvm的heap
    http://localhost:8888/actuator/threaddump 当前jvm的线程快照
    http://localhost:8888/actuator/httptrace  最近的100个http请求,包括request和response内容。

    http://localhost:8888/actuator/mappings 所有的spring-mvc http接口
     
    总结:
    1.部分接口如果暴露在公网,很危险,需要配置好网关出口规则。
    2.可以用这些接口做一些服务监控,管理工作。



  • 相关阅读:
    [USACO07FEB]银牛派对Silver Cow Party
    道路重建
    javascript基础
    css清除浮动
    css水平居中
    块元素与行内(内嵌)元素的区别
    hook
    回调函数
    Web服务API
    Enrolment注册插件
  • 原文地址:https://www.cnblogs.com/kevin7234/p/10629567.html
Copyright © 2011-2022 走看看