Fork me on GitHub

Pinpoint agent 手册

本文基于 Pinpoint 2.1.0 版本, 本文 的agent 是已经更改过的源码后编译的,具体改动的部分就是: agentID 长度 和 name 的限制。

  1. 更改后: agentID 和Name 支持 48位字符,默认只支持 24位

场景: 我们的场景是部署在容器中

实现: 我们通过在所有的容器所在的宿主机进行存放 agent 包,然后 容器进行挂载目录,挂载完目录后通过更改 启动命令来进行加载。

一、配置文件修改

配置文件 pinpoint-root.config

配置中profiler.collector.ipprofiler.transport.grpc.collector.ip 文件所有使用到这个配置的,都需要更改为我们的 collector 的IP。

采样率更改 profiler.sampling.rate

# 1 out of n transactions will be sampled where n is the rate. (1: 100%, 20: 5%)
profiler.sampling.rate=10

设置为 10 表示采样 10%(1/10)

二、启动命令设置

涉及到以下几个配置

  • -javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar

Additionally, Pinpoint Agent requires 2 command-line arguments in order to identify itself in the distributed system:

  • -Dpinpoint.agentId - uniquely identifies the application instance in which the agent is running on
  • -Dpinpoint.applicationName - groups a number of identical application instances as a single service
  • -Dpinpoint.container in addition to the 2 required command-line arguments above when launching the agent.

示例:

注意同一个应用的多个实例,遵循,applicationName 要一致, agentId 要区分。

将下面的命令配置到 JAVA_OPTS 或者直接加到启动命令。

-javaagent:/opt/pinpoint/pinpoint-agent/pinpoint-bootstrap.jar  -Dpinpoint.agentId=${SERVICE_NAME}  -Dpinpoint.applicationName=${CONTAINER_NAME%_*}  -Dpinpoint.container=${SERVICE_NAME}

需要注意的是我上面的配置不是通用了,因为我是获取了环境变量的值然后进行切割 , ${SERVICE_NAME} {CONTAINER_NAME%_*}

posted @   自由早晚乱余生  阅读(2125)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
历史上的今天:
2018-11-26 tomcat安装以及常用配置
点击右上角即可分享
微信分享提示