Arthas Spring Boot Starter

只支持 Spring Boot 2

依赖配置

配置maven依赖:

<dependency>
    <groupId>com.taobao.arthas</groupId>
    <artifactId>arthas-spring-boot-starter</artifactId>
    <version>${arthas.version}</version>
</dependency>

应用启动后,Spring会启动arthas,并且attach自身进程。

配置属性

比如,通过配置tunnel server实现远程管理:

arthas.agent-id=hsehdfsfghhwertyfad
arthas.tunnel-server=ws://47.75.156.201:7777/ws

全部支持的配置项:参考

查看Endpoint信息

需要配置Spring Boot暴露endpoint参考

假定endpoint端口是 8080,则通过下面url可以查看:

http://localhost:8080/actuator/arthas

{
    "arthasConfigMap": {
        "agent-id": "hsehdfsfghhwertyfad",
        "tunnel-server": "ws://47.75.156.201:7777/ws",
    }
}

非Spring Boot应用使用方式

非Spring Boot应用,可以通过下面的方式来使用:

<dependency>
    <groupId>com.taobao.arthas</groupId>
    <artifactId>arthas-agent-attach</artifactId>
    <version>${arthas.version}</version>
</dependency>
<dependency>
    <groupId>com.taobao.arthas</groupId>
    <artifactId>arthas-packaging</artifactId>
    <version>${arthas.version}</version>
</dependency>
import com.taobao.arthas.agent.attach.ArthasAgent;

public class ArthasAttachExample {

    public static void main(String[] args) {
        ArthasAgent.attach();
    }

}
上一篇 Arthas(阿尔萨斯) -- 阿里在线诊断神器
下一篇 以太坊学习1:分布式账本
目录
文章列表
1 深度学习基础:线性代数(4)_范数
深度学习基础:线性代数(4)_范数
2
MongoDB后台管理Shell
MongoDB后台管理Shell
3
K8s将Pod指定部署到特定节点(master)上的一种方法
K8s将Pod指定部署到特定节点(master)上的一种方法
4
因为BitMap,白白搭进去8台服务器...
因为BitMap,白白搭进去8台服务器...
5
Atlas技巧
Atlas技巧
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。