官方 github 地址:https://github.com/glowroot/glowroot

WIKI:https://github.com/glowroot/glowroot/wiki

简介

glowRoot 工具是一款轻量级、低开销的 Java 应用性能监控工具(APM),主要用于追踪 Java 应用的请求执行链路、方法耗时、JDBC 执行耗时。核心实现基于 Java Agent、字节码增强技术。

部署模式

glowRoot 支持两种部署方式

模式一:嵌入式(Embedded)

监控数据写入本地数据库或**Cassandra(一款开源的分布式 NoSQL 数据库), WebUI **内置在本地,只适合单机服务

模式二:中心化(Central)

多个应用实例将数据发送到 Glowroot Central(独立服务),Central 使用 Cassandra 作为后端存储。

安装

Docker 部署

安装 Central

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
services:
glowroot:
image: glowroot/glowroot-central:0.14.4
container_name: glowroot
environment:
- CASSANDRA_CONTACT_POINTS=cassandra
ports:
- "8181:8181" # agent端口
- "4000:4000" # UI
networks:
- glowroot_net

cassandra:
container_name: cassandra
image: cassandra:4.1.5
ports:
- "7000:7000/tcp"
- "9042:9042/tcp" # 数据端口
networks:
- glowroot_net

networks:
glowroot_net:

安装 agent

下载 agent https://github.com/glowroot/glowroot/releases/download/v0.14.4/glowroot-0.14.4-dist.zip

基本文件结构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
lib/
└── glowroot/
├── lib/
├── glowroot-central-collector-https-linux.jar
├── glowroot-central-collector-https-osx.jar
├── glowroot-central-collector-https-windows.jar
├── glowroot-embedded-collector.jar
└── glowroot-logging-logstash.jar

├── logs/
└── glowroot.2026-01-15.log

├── tmp/
├── lock
├── plugin-pointcuts.jar
└── preload-some-super-types-cache

├── config.json
├── config.synced
├── glowroot.jar
├── glowroot.properties
├── LICENSE
└── NOTICE

启动

1
2
3
4
5
6
7
8
9
# 启动时添加参数  agent.id 为可选,collector.address必填
java -jar --javaagent=path/to/glowroot.jar \
—Dglowroot.agent.id=xxxx \
-Dglowroot.collector.address=http://hostname:port


# 也可以编辑properties文件
agent.id=xxxxx
collector.address=http://hostname:port

本地部署

本地部署同理,修改相应的 jvm 参数即可