Pinpoint Agent启动过程分析

本文详述了Pinpoint Agent的启动过程,从PinpointBootStrap.premain方法开始,包括设置启动状态、解析参数、加载插件、实例化ServiceTypeRegistry和AnnotationKeyRegistry,以及启动监控线程等步骤。通过对1.7.2版本的分析,展示了其相对简洁的启动逻辑。

Pinpoint是一款全链路分析工具,提供了无侵入式的调用链监控、方法执行详情查看、应用状态信息监控等功能。目前公司通过开发pinpoint来满足链路分析、中间件增强、环境隔离等需求,图1为pinpoint的基本结构。
图1.Pinpoint基本结构

​ 总的来说,pinpoint-agent通过在各种中间件方法上埋点来采集信息,数据上报到pinpoint-collector,由pinpoint-collector接收并持久化到hbase,pinpoint-web负责渲染,在pinpoint-collector和pinpoint-web之间还会维护一条长连接,负责传输实时数据。

​ 本文主要分析pinpoint-agent的启动过程,pinpoint的版本为1.7.2,与目前最新版有一定差异(当前最新版为1.9.0)。

Pinpoint Agent启动过程

  1. 启动入口为PinpointBootStrap.premain方法
  2. 设置启动状态,解析启动参数,查找核心jar文件,使用BootstrapClassLoader加载核心jar中的类
  3. 实例化PinpointStarter,调用start方法
public static void premain(String agentArgs, Instrumentation instrumentation) {
   
   
        if (agentArgs == null) {
   
   
            agentArgs = "";
        }
        logger.info(ProductInfo.NAME + " agentArgs:" + agentArgs);
        final boolean success = STATE.start();
        if (!success) {
   
   
            logger.warn("pinpoint-bootstrap already started. skipping agent loading.");
            return;
        }
        Map<String, String> agentArgsMap = argsToMap(agentArgs);
        final ClassPathResolver classPathResolver = new 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值