天天看点

pinpoint客户端配置

pinpoint版本2.2.2

基本配置

pinpoint2.x版本之后,其配置方式已调整为由profile控制。

不同环境的配置文件对应在不同的profile目录profiles/*,默认使用profile为release。

系统运行时使用哪个profile,需要使用启动参数置顶:

-Dpinpoint.profiler.profiles.active=release #local,test,prod
           

因此修改配置文件时需要修改修改对应目录中的配置文件。

参数配置

配置文件:profiles/release/pinpoint.config

基本参数配置:

        1. profiler.transport.module=THRIFT # 指定传输协议为iTHRIFT

        2. profiler.collector.ip= x.x.x.x #指定服务端IP地址

        3. profiler.sampling.enable=true # 开启采样

                profiler.sampling.rate=N #设置采样率为1/N,这里的N表示每N此请求采样一条请求数据

组件参数配置:

        pinpoint虽然支持很多技术组件,但并不是所有组件都是默认开启的,需要在配置文件中配置开启及对应的参数采可以。

        例如:

profiler.springboot.enable=true
profiler.reactor-netty.enable=true
profiler.kafka.producer.enable=true # 基于kafka消息的traceId传递,需要kafka版本0.10以上
profiler.kafka.consumer.enable=true
profiler.resttemplate=true
           

快捷配置

        所有在配置文件中配置的参数都可以通过启动参数配置,配置方式如下:

         -Dpinpoint.profiler.profiles.active=release

        -Dprofiler.collector.ip= 127.0.0.1 

        -Dpinpoint.applicationName=xxx

        -Dpinpoint.agentId=${IP}-${PORT}