Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] support rabbitmq and activemq help doc #564

Merged
merged 4 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions home/docs/help/activemq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
id: activemq
title: 监控 Apache ActiveMQ 消息中间件
sidebar_label: ActiveMQ消息中间件
---

> 对 Apache ActiveMQ 消息中间件的运行状态,节点,Topic等相关指标进行监测。

**使用协议:JMX**

### 监控前操作

> 您需要在 ActiveMQ 开启 `JMX` 服务,HertzBeat 使用 JMX 协议对 ActiveMQ 进行指标采集。

1. 修改安装目录下的 `conf/activemq.xml` 文件,开启JMX

> 在 `broker` 标签中添加 `userJmx="true"` 属性

```xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker>
```

2. 修改安装目录下的 `bin/env` 文件,配置JMX 端口 IP等

将如下原配置信息
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"

ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
更新为如下配置,⚠️注意修改`本机对外IP`
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"

ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"

ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```

3. 重启 ACTIVEMQ 服务,在 HertzBeat 添加对应 ActiveMQ 监控即可,参数使用 JMX 配置的 IP 端口。

### 配置参数

| 参数名称 | 参数帮助描述 |
|-------------|------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| JMX端口 | JMX 对外提供的HTTP端口,默认为 11099。 |
| JMX URL | 可选,自定义 JMX URL 连接 |
| 用户名 | 认证时使用的用户名 |
| 密码 | 认证时使用的密码 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 |
| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 |

### 采集指标

#### 指标集合:broker

| 指标名称 | 指标单位 | 指标帮助描述 |
|-------------------------|------|-----------------------------------------------------------------------|
| BrokerName | 无 | The name of the broker. |
| BrokerVersion | 无 | The version of the broker. |
| Uptime | 无 | Uptime of the broker. |
| UptimeMillis | ms | Uptime of the broker in milliseconds. |
| Persistent | 无 | Messages are synchronized to disk. |
| MemoryPercentUsage | % | Percent of memory limit used. |
| StorePercentUsage | % | Percent of store limit used. |
| TempPercentUsage | % | Percent of temp limit used. |
| CurrentConnectionsCount | 无 | Attribute exposed for management |
| TotalConnectionsCount | 无 | Attribute exposed for management |
| TotalEnqueueCount | 无 | Number of messages that have been sent to the broker. |
| TotalDequeueCount | 无 | Number of messages that have been acknowledged on the broker. |
| TotalConsumerCount | 无 | Number of message consumers subscribed to destinations on the broker. |
| TotalProducerCount | 无 | Number of message producers active on destinations on the broker. |
| TotalMessageCount | 无 | Number of unacknowledged messages on the broker. |
| AverageMessageSize | 无 | Average message size on this broker |
| MaxMessageSize | 无 | Max message size on this broker |
| MinMessageSize | 无 | Min message size on this broker |

#### 指标集合:topic

| 指标名称 | 指标单位 | 指标帮助描述 |
|-------------------------|------|-------------------------------------------------------------------------------------------|
| Name | 无 | Name of this destination. |
| MemoryLimit | MB | Memory limit, in bytes, used by undelivered messages before paging to temporary storage. |
| MemoryPercentUsage | 无 | The percentage of the memory limit used |
| ProducerCount | 无 | Number of producers attached to this destination |
| ConsumerCount | 无 | Number of consumers subscribed to this destination. |
| EnqueueCount | 无 | Number of messages that have been sent to the destination. |
| DequeueCount | 无 | Number of messages that has been acknowledged (and removed) from the destination. |
| ForwardCount | 无 | Number of messages that have been forwarded (to a networked broker) from the destination. |
| InFlightCount | 无 | Number of messages that have been dispatched to, but not acknowledged by, consumers. |
| DispatchCount | 无 | Number of messages that has been delivered to consumers, including those not acknowledged |
| ExpiredCount | 无 | Number of messages that have been expired. |
| StoreMessageSize | B | The memory size of all messages in this destination's store. |
| AverageEnqueueTime | ms | Average time a message was held on this destination. |
| MaxEnqueueTime | ms | The longest time a message was held on this destination |
| MinEnqueueTime | ms | The shortest time a message was held on this destination |
| TotalBlockedTime | ms | Total time (ms) messages have been blocked by flow control |
| AverageMessageSize | B | Average message size on this destination |
| MaxMessageSize | B | Max message size on this destination |
| MinMessageSize | B | Min message size on this destination |


#### 指标集合:memory_pool

| 指标名称 | 指标单位 | 指标帮助描述 |
|-----------| ----------- | ----------- |
| name | 无 | 指标名称 |
| committed | kb | 总量 |
| init | kb | 初始化大小 |
| max | kb | 最大 |
| used | kb | 已使用 |

#### 指标集合:class_loading

| 指标名称 | 指标单位 | 指标帮助描述 |
|-----------------------| ----------- | ----------- |
| LoadedClassCount | 个 | 已加载类数量 |
| TotalLoadedClassCount | 个 | 历史已加载类总量 |
| UnloadedClassCount | 个 | 未加载类数量 |


#### 指标集合:thread

| 指标名称 | 指标单位 | 指标帮助描述 |
|-------------------------| ----------- | ----------- |
| TotalStartedThreadCount | 个 | 已经开始的线程数量 |
| ThreadCount | 个 | 线程数 |
| PeakThreadCount | 个 | 未加载类数量 |
| DaemonThreadCount | 个 | 守护进程数 |
| CurrentThreadUserTime | ms | 使用时间 |
| CurrentThreadCpuTime | ms | 使用CPU时间 |
2 changes: 1 addition & 1 deletion home/docs/help/dynamic_tp.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: dynamic_tp
title: 监控:DynamicTp 线程池监控
sidebar_label: DynamicTp 线程池监控
sidebar_label: DynamicTp线程池监控

---

Expand Down
2 changes: 2 additions & 0 deletions home/docs/help/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ sidebar_label: 帮助入门
&emsp;&#x1F449;&emsp;[Tomcat](tomcat) <br />
&emsp;&#x1F449;&emsp;[ShenYu](shenyu) <br />
&emsp;&#x1F449;&emsp;[DynamicTp](dynamic_tp) <br />
&emsp;&#x1F449;&emsp;[RabbitMQ](rabbitmq) <br />
&emsp;&#x1F449;&emsp;[ActiveMQ](activemq) <br />

### 云原生监控

Expand Down
77 changes: 41 additions & 36 deletions home/docs/help/jvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ sidebar_label: JVM虚拟机

**使用协议:JMX**

### 监控前操作

> 您需要在 JVM 应用开启 `JMX` 服务,HertzBeat 使用 JMX 协议对 JVM 进行指标采集。

#### JVM应用开启JMX协议步骤

应用启动时添加JVM参数 ⚠️注意可自定义暴露端口,对外IP

参考文档: https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote

```shell
-Djava.rmi.server.hostname=对外ip地址
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
```

### 配置参数

| 参数名称 | 参数帮助描述 |
Expand All @@ -27,52 +44,40 @@ sidebar_label: JVM虚拟机
#### 指标集合:memory_pool

| 指标名称 | 指标单位 | 指标帮助描述 |
| ----------- | ----------- | ----------- |
| name | 无 | 指标名称 |
| committed | kb | 总量 |
| init | kb | 初始化大小 |
| max | kb | 最大 |
| used | kb | 已使用 |
|-----------| ----------- | ----------- |
| name | 无 | 指标名称 |
| committed | kb | 总量 |
| init | kb | 初始化大小 |
| max | kb | 最大 |
| used | kb | 已使用 |

#### 指标集合:code_cache (限JDK8及以下)

| 指标名称 | 指标单位 | 指标帮助描述 |
| ----------- | ----------- | ----------- |
| committed | kb | 总量 |
| init | kb | 初始化大小 |
| max | kb | 最大 |
| used | kb | 已使用 |
|-----------| ----------- | ----------- |
| committed | kb | 总量 |
| init | kb | 初始化大小 |
| max | kb | 最大 |
| used | kb | 已使用 |

#### 指标集合:class_loading

| 指标名称 | 指标单位 | 指标帮助描述 |
| ----------- | ----------- | ----------- |
| LoadedClassCount | 个 | 已加载类数量 |
| TotalLoadedClassCount | 个 | 历史已加载类总量 |
| UnloadedClassCount | 个 | 未加载类数量 |
| 指标名称 | 指标单位 | 指标帮助描述 |
|-----------------------| ----------- | ----------- |
| LoadedClassCount | 个 | 已加载类数量 |
| TotalLoadedClassCount | 个 | 历史已加载类总量 |
| UnloadedClassCount | 个 | 未加载类数量 |


#### 指标集合:thread

| 指标名称 | 指标单位 | 指标帮助描述 |
| ----------- | ----------- | ----------- |
| TotalStartedThreadCount | 个 | 已经开始的线程数量 |
| ThreadCount | 个 | 线程数 |
| PeakThreadCount | 个 | 未加载类数量 |
| DaemonThreadCount | 个 | 守护进程数 |
| CurrentThreadUserTime | ms | 使用时间 |
| CurrentThreadCpuTime | ms | 使用CPU时间 |

### JVM应用开启JMX协议步骤
| 指标名称 | 指标单位 | 指标帮助描述 |
|-------------------------| ----------- | ----------- |
| TotalStartedThreadCount | 个 | 已经开始的线程数量 |
| ThreadCount | 个 | 线程数 |
| PeakThreadCount | 个 | 未加载类数量 |
| DaemonThreadCount | 个 | 守护进程数 |
| CurrentThreadUserTime | ms | 使用时间 |
| CurrentThreadCpuTime | ms | 使用CPU时间 |

1. 应用启动时添加JVM参数 ⚠️注意可自定义暴露端口,对外IP

参考文档: https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote

```shell
-Djava.rmi.server.hostname=对外ip地址
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
```

40 changes: 22 additions & 18 deletions home/docs/help/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ sidebar_label: Kafka监控

**使用协议:JMX**

### 监控前操作

> 您需要在 Kafka 开启 `JMX` 服务,HertzBeat 使用 JMX 协议对 Kafka 进行指标采集。

1. 安装部署 Kafka 服务

2. 修改 Kafka 启动脚本

修改 Kafka 安装目录下的启动脚本 `/bin/kafka-server-start.sh`
在倒数第二行添加如下内容, ⚠️注意替换您自己的端口和对外 IP 地址

```shell
export JMX_PORT=9999;
export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=ip地址 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false";

# 这是最后一行本来就存在的
# exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
```

3. 重启 Kafka 服务

### 配置参数

| 参数名称 | 参数帮助描述 |
Expand Down Expand Up @@ -76,22 +97,5 @@ sidebar_label: Kafka监控
| FifteenMinuteRate | 无 | 十五分钟处理率 |


> 其他指标见文知意

### Kafka开启JMX协议步骤

1. 安装Kafka

2. 修改启动脚本

找到Kafka安装目录/bin/kafka-server-start.sh在 倒数第二行添加如下内容,⚠️注意替换端口和IP地址

```shell
export JMX_PORT=9999;
export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=ip地址 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false";

// 这是最后一行本来就存在的
exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
```

> 其他指标见文知意,欢迎贡献一起优化文档。

Loading