天天看點

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}