1.背景知识
Application Performance Management是什么?
维基百科:
In the fields of information technology and systems management, Application Performance Management (APM) is the monitoring and management of performance and availability of software applications. APM strives to detect and diagnose complex application performance problems to maintain an expected level of service. APM is “the translation of IT metrics into business meaning ([i.e.] value).”
APM监控和管理软件应用的性能和可用性,探测和诊断复杂的应用性能问题。
APM 理论框架:
APM的鼻祖是Google Dapper
英文版paper: http://research.google.com/pubs/pub36356.html
中文翻译版: http://bigbully.github.io/Dapper-translation/
国外工具列表:
ZIPKIN: https://github.com/openzipkin/zipkin
pinpoint:https://github.com/naver/pinpoint
appdash: https://github.com/sourcegraph/appdash
国内工具列表:
阿里的鹰眼介绍: http://club.alibabatech.org/resource_detail.htm?topicId=102
点评的cat: https://github.com/dianping/cat
京东的hydra(不维护): https://github.com/odenny/hydra
还有个商业化的oneAPM。
本文以naver的pinpoint为例,搭建一套自己的APM平台。
2.pinpoint介绍
Pinpoint provides a solution to help analyze the overall structure of the system and how components within them are interconnected by tracing transactions across distributed applications.
Install agents without changing a single line of code
Minimal impact on performance (approximately 3% increase in resource usage)
Pinpoint能帮助分析整个系统架构,在分布式应用中通过追踪事务解释系统组件间是怎么进行连接的。
Pinpoint架构图:
Pinpoint由4部分组成:
1.Pinpoint Agent, 2. Pinpoint Collector, 3. HBase, 4.Pinpoint Web UI
其中2,4必须启web容器。
Pinpoint使用了字节码增强技术,在类加载时,注入到观察的应用Class文件中。
所以在启动应用时,必须设置-javaagent为Pinpoint的agent。
目前Pinpo