This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new 9197521135 update observability docs (#2493)
9197521135 is described below
commit 91975211356db9f806c79fd1641d2955c31c12a5
Author: Ken Liu <[email protected]>
AuthorDate: Mon Apr 3 20:47:38 2023 +0800
update observability docs (#2493)
---
content/zh-cn/overview/reference/Metrics/_index.md | 7 ++
.../overview/reference/Metrics/standard_metrics.md | 55 ++++++++++
content/zh-cn/overview/reference/admin/_index.md | 2 +-
.../overview/reference/integrations/_index.md | 2 +-
.../overview/reference/integrations/grafana.md | 47 ++++----
.../overview/reference/integrations/prometheus.md | 58 +++++++---
.../zh-cn/overview/reference/proposals/_index.md | 2 +-
.../zh-cn/overview/tasks/observability/admin.md | 2 +-
.../zh-cn/overview/tasks/observability/grafana.md | 120 ++++++++++-----------
.../overview/tasks/observability/prometheus.md | 61 +++--------
10 files changed, 207 insertions(+), 149 deletions(-)
diff --git a/content/zh-cn/overview/reference/Metrics/_index.md
b/content/zh-cn/overview/reference/Metrics/_index.md
new file mode 100644
index 0000000000..4354fe751b
--- /dev/null
+++ b/content/zh-cn/overview/reference/Metrics/_index.md
@@ -0,0 +1,7 @@
+---
+description: ""
+linkTitle: Metrics
+title: Metrics
+type: docs
+weight: 20
+---
diff --git a/content/zh-cn/overview/reference/Metrics/standard_metrics.md
b/content/zh-cn/overview/reference/Metrics/standard_metrics.md
new file mode 100644
index 0000000000..edcc705164
--- /dev/null
+++ b/content/zh-cn/overview/reference/Metrics/standard_metrics.md
@@ -0,0 +1,55 @@
+---
+linkTitle: 标准监控指标
+title: Dubbo 框架标准监控指标
+type: docs
+weight: 1
+description: |
+ 描述了 Dubbo 中统计的一些标准监控指标。
+---
+
+### Dubbo 指标含义
+#### Provider Metrics
+
+| 指标 | 含义 |
+|-------------------------------------------|------------------------|
+| dubbo_provider_qps_total | 提供者每秒接收的请求数 |
+| dubbo_provider_requests_total | 提供者总的接收请求数 |
+| dubbo_provider_requests_processing | 提供者正在处理的接收的请求数 |
+| dubbo_provider_requests_succeed_total | 提供者请求成功接收的请求数 |
+| dubbo_provider_requests_total_aggregate | 滑动窗口下的提供者总的接收请求数 |
+| dubbo_provider_requests_succeed_aggregate | 滑动窗口下的提供者成功的接收请求数 |
+| dubbo_provider_rt_milliseconds_min | 提供者所有处理请求中最小的响应时间 |
+| dubbo_provider_rt_milliseconds_avg | 提供者所有处理请求的平均响应时间 |
+| dubbo_provider_rt_milliseconds_sum | 提供者所有处理请求的时间总和 |
+| dubbo_provider_rt_milliseconds_max | 提供者所有请求中最大的响应时间 |
+| dubbo_provider_rt_milliseconds_last | 提供者处理请求中当前的响应时间 |
+| dubbo_provider_rt_milliseconds_p95 | 提供者处理请求中95%的请求耗费的总响应时间 |
+| dubbo_provider_rt_milliseconds_p99 | 提供者处理请求中99%的请求耗费的总响应时间 |
+
+
+#### Consumer Metrics
+
+| 指标 | 含义
|
+|-------------------------------------------|
----------------------------------------- |
+| dubbo_consumer_qps_total | 消费者每秒发送的请求数 |
+| dubbo_consumer_requests_total | 消费者总的发送请求数 |
+| dubbo_consumer_requests_processing | 消费者正在处理的发送的请求数 |
+| dubbo_provider_requests_succeed_total | 消费者请求成功发送的请求数 |
+| dubbo_consumer_requests_total_aggregate | 滑动窗口下的消费者总的发送请求数 |
+| dubbo_consumer_requests_succeed_aggregate | 滑动窗口下的消费者成功的发送请求数 |
+| dubbo_consumer_rt_milliseconds_min | 消费者所有请求中最小的响应时间 |
+| dubbo_consumer_rt_milliseconds_avg | 消费者所有请求的平均响应时间
|
+| dubbo_consumer_rt_milliseconds_sum | 消费者所有请求的时间总和
|
+| dubbo_consumer_rt_milliseconds_max | 消费者所有请求中最大的响应时间 |
+| dubbo_consumer_rt_milliseconds_last | 消费者处理请求中当前的响应时间 |
+| dubbo_consumer_rt_milliseconds_p95 | 消费者处理请求中95%的请求耗费的总响应时间 |
+| dubbo_consumer_rt_milliseconds_p99 | 消费者处理请求中99%的请求耗费的总响应时间 |
+
+#### ThreadPool Metrics
+todo
+#### Registration Center Metrics
+todo
+#### Metadata Center Metrics
+todo
+#### Configuration Center Metrics
+todo
\ No newline at end of file
diff --git a/content/zh-cn/overview/reference/admin/_index.md
b/content/zh-cn/overview/reference/admin/_index.md
index fa89e7bc1f..b7c2acf047 100644
--- a/content/zh-cn/overview/reference/admin/_index.md
+++ b/content/zh-cn/overview/reference/admin/_index.md
@@ -3,5 +3,5 @@ description: ""
linkTitle: Admin
title: Admin 控制台操作手册
type: docs
-weight: 1
+weight: 10
---
diff --git a/content/zh-cn/overview/reference/integrations/_index.md
b/content/zh-cn/overview/reference/integrations/_index.md
index fd6e6db27e..b03a8e66c6 100644
--- a/content/zh-cn/overview/reference/integrations/_index.md
+++ b/content/zh-cn/overview/reference/integrations/_index.md
@@ -5,5 +5,5 @@ description: ""
linkTitle: 集成适配
title: 集成适配
type: docs
-weight: 1
+weight: 30
---
diff --git a/content/zh-cn/overview/reference/integrations/grafana.md
b/content/zh-cn/overview/reference/integrations/grafana.md
index cb9eae1083..0d36042696 100644
--- a/content/zh-cn/overview/reference/integrations/grafana.md
+++ b/content/zh-cn/overview/reference/integrations/grafana.md
@@ -8,40 +8,49 @@ type: docs
weight: 3
---
+## 安装
+### Kubernetes 安装
+
+你可以使用 Dubbo 社区提供的示例配置快速安装 Grafana,安装后的 Grafana 提供了社区默认指标面板视图。
-### Linux
-下载项目至本地到切换指定项目
```bash
-wget https://dl.grafana.com/oss/release/grafana-9.3.6-1.x86_64.rpm && yum
install -y grafana-9.3.6-1.x86_64.rpm
+kubectl create -f .
```
-启动服务
-```bash
-systemctl daemon-reload && systemctl enable --now grafana-server
+获得访问地址
+```sh
+$ kubectl port-forward service/grafana 3000:3000
```
-访问页面
+访问页面 `http://localhost:3000`
-`http://localhost:3000` 默认用户名与密码为`admin`

+> 获取登录信息
+> ```bash
+> kubectl get secrets grafana -o jsonpath="{.data.admin-user}" | base64
--decode ; echo && kubectl get secrets grafana -o
jsonpath="{.data.admin-password}" | base64 --decode ; echo
+> ```
-### Kubernetes
+### VM 安装
下载项目至本地到切换指定项目
-```bash
-git clone https://github.com/apache/dubbo-admin.git && cd
dubbo-admin/kubernetes/grafana
-```
-创建项目
```bash
-kubectl create -f .
+wget https://dl.grafana.com/oss/release/grafana-9.3.6-1.x86_64.rpm && yum
install -y grafana-9.3.6-1.x86_64.rpm
```
-获取登录信息
+启动服务
```bash
-kubectl get secrets grafana -o jsonpath="{.data.admin-user}" | base64 --decode
; echo && kubectl get secrets grafana -o jsonpath="{.data.admin-password}" |
base64 --decode ; echo
+systemctl daemon-reload && systemctl enable --now grafana-server
```
-访问页面
-`http://localhost:3000`
-
\ No newline at end of file
+访问页面 `http://localhost:3000`,默认用户名与密码为`admin`
+
+
+
+## 配置数据面板
+
+以下是 Dubbo 社区提供的默认指标面板,您配置好数据源并直接导入使用即可。如果默认面板不能满足要求,您还可以自定义 Grafana 面板。
+
+**Apache Dubbo Observability Dashboard:**
[https://grafana.com/grafana/dashboards/18051](https://grafana.com/grafana/dashboards/18051)
+
+**JVM (Micrometer) Dashboard:**
[https://grafana.com/grafana/dashboards/4701](https://grafana.com/grafana/dashboards/4701)
\ No newline at end of file
diff --git a/content/zh-cn/overview/reference/integrations/prometheus.md
b/content/zh-cn/overview/reference/integrations/prometheus.md
index 8b68dc14a1..a0d889704f 100644
--- a/content/zh-cn/overview/reference/integrations/prometheus.md
+++ b/content/zh-cn/overview/reference/integrations/prometheus.md
@@ -10,34 +10,64 @@ weight: 2
## 安装
+### Kubernetes
+你可以使用 Dubbo 社区提供的示例配置快速安装 Prometheus。
+
+```bash
+kubectl create -f .
+```
+> 本安装仅适用于测试或体验使用,生产级别的安装请参考 Prometheus 官方安装文档。
+
+访问页面 `http://localhost:9090`
+
+
+
+### VM
+以 Linux 为例,下载项目至本地并切换指定项目
-### Linux
-下载项目至本地到切换指定项目
```bash
wget
https://github.com/prometheus/prometheus/releases/download/v2.42.0/prometheus-2.42.0.linux-amd64.tar.gz
&& tar zxvf prometheus-2.42.0.linux-amd64.tar.gz && mv
prometheus-2.42.0.linux-amd64 prometheus && cd prometheus
```
后台运行
+
```bash
nohup ./prometheus > /dev/null 2>&1 &
```
-访问页面
-`http://localhost:9090`
+访问页面 `http://localhost:9090`
+

+> 具体请参考 Prometheus 官方安装文档
-### Kubernetes
-下载项目至本地到切换指定项目
-```bash
-git clone https://github.com/apache/dubbo-admin.git && cd
dubbo-admin/kubernetes/prometheus
+
+## Scrape 配置
+
+Dubbo 的每个实例都会暴露一个 http 端口用于 Metrics 采集,Prometheus 通过 scraping 每个实例的 http
接口来采集统计数据。具体的 scraping 路径可以通过 Prometheus 配置文件进行调整,该文件控制 scraping 实例的端口、路径、TLS
设置等。
+
+### Kubernetes 注解约定
+
+在 Kubernetes 部署模式下,使用官方社区维护的 Helm Charts 安装 Prometheus,Prometheus 可以自动识别包含
`prometheus.io` 注解的 Dubbo Pod 实例,并将它们列入 Scraping 实例列表。
+
+Dubbo 官网给出的示例即是基于 `prometheus.io` 注解实现了 scraping target 地址的自动发现,具体注解配置可参见示例中的
[Deployment
资源定义](https://github.com/apache/dubbo-samples/blob/master/4-governance/dubbo-samples-metrics-spring-boot/Deployment.yml)。
+
+```yaml
+annotations:
+ prometheus.io/scrape: "true"
+ prometheus.io/path: /management/prometheus
+ prometheus.io/port: "22222"
```
-创建项目
-```bash
-kubectl create -f .
+在此模式下,Dubbo 实例默认提供的 Prometheus Metrics 采集路径是:`/management/prometheus`。
+
+### 自定义配置
+
+对于已经安装好的 Prometheus 服务,可以通过 Dubbo Admin 提供的 Prometheus http_sd 服务发现接口来配置 Dubbo
Metrics 采集的目标实例。可以参考 Admin 安装相关文档,安装完成后 Prometheus 侧的配置如下:
+
+```yaml
+- job_name: 'dubbo'
+ http_sd_configs:
+ - url: http://{admin-address}/api/dev/metrics/prometheus
```
-访问页面
-`http://localhost:9090`
-
\ No newline at end of file
diff --git a/content/zh-cn/overview/reference/proposals/_index.md
b/content/zh-cn/overview/reference/proposals/_index.md
index ba0fb5d910..6e99672a64 100644
--- a/content/zh-cn/overview/reference/proposals/_index.md
+++ b/content/zh-cn/overview/reference/proposals/_index.md
@@ -5,5 +5,5 @@ description: ""
linkTitle: 提案
title: 提案
type: docs
-weight: 2
+weight: 40
---
diff --git a/content/zh-cn/overview/tasks/observability/admin.md
b/content/zh-cn/overview/tasks/observability/admin.md
index ea798c5de9..4d9e1f185f 100644
--- a/content/zh-cn/overview/tasks/observability/admin.md
+++ b/content/zh-cn/overview/tasks/observability/admin.md
@@ -14,7 +14,7 @@ weight: 1
> Dubbo Admin 已经升级为 Dubbo 服务治理统一入口,涵盖的范围非常广泛,本文讲解的只是 Admin 可视化控制台部分。
## 安装 Admin
-首先,需要正确 [安装&配置 Dubbo Admin](https://github.com/apache/dubbo-admin#dubbo-admin)
控制台
+首先,需要正确 [安装&配置 Dubbo Admin](../../../reference/admin/architecture/) 控制台
## 功能介绍
Admin 控制台提供了从开发、测试到流量治理等不同层面的丰富功能,功能总体上可分为以下几类:
diff --git a/content/zh-cn/overview/tasks/observability/grafana.md
b/content/zh-cn/overview/tasks/observability/grafana.md
index 8674e62a04..032996e96b 100644
--- a/content/zh-cn/overview/tasks/observability/grafana.md
+++ b/content/zh-cn/overview/tasks/observability/grafana.md
@@ -6,86 +6,76 @@ linkTitle: Grafana
no_list: true
title: 使用 Grafana 可视化查看集群 Metrics 指标
type: docs
-weight: 2
+weight: 20
---
+指标可视化页面目前推荐的方式是使用 Grafana 来配置 Dubbo 的可观测性监控大盘。
+## 在您开始之前
+- 一个可以访问的 Kubernetes 集群
+- 正确安装并配置 [普罗米修斯服务](../../../reference/integrations/prometheus)
+- 安装 [Grafana](../../../reference/integrations/grafana)
+- 部署
[示例应用](https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-spring-boot)
-这个示例演示了如何使用 Grafana 可视化的展示 Metrics 监控指标
+## 确认组件正常运行
-## 开始之前
-* 安装 Prometheus
-* 安装 Grafana
-* 部署示例项目
-
-## 查看 Grafana 面板
+### Kubernetes
+确保 Prometheus 正常运行
+```sh
+$ kubectl -n dubbo-system get svc prometheus
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+prometheus ClusterIP 10.0.250.230 <none> 9090/TCP 180s
+```
-## 示例详解
-### 参考案例
-Dubbo官方案例中提供了指标埋点的示例,可以访问如下地址获取案例源码:
-- Spring项目参考案例:
- -
[https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-prometheus](https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-prometheus)
-- SpringBoot项目参考案例:
- -
[https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-spring-boot](https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-spring-boot)
+确保 Grafana 正常运行
-### 依赖
-目前Dubbo的指标埋点仅支持3.2及以上版本,同时需要引入dubbo-metrics-prometheus依赖如下所示:
-```xml
-<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-metrics-prometheus</artifactId>
- <version>3.2及以上版本</version>
-</dependency>
+```sh
+$ kubectl -n dubbo-system get svc grafana
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+grafana ClusterIP 10.0.244.130 <none> 3000/TCP 180s
```
-### 配置
-开启Dubbo的指标埋点只需要引入以下配置即可。
-```xml
-<dubbo:metrics protocol="prometheus" enable-jvm-metrics="true">
- <dubbo:aggregation enabled="true"/>
- <dubbo:prometheus-exporter enabled="true" metrics-port="20888"/>
-</dubbo:metrics>
-```
-关于指标的配置可以参考配置项中的指标配置信息,在这里引入的配置中:
-- **enable-jvm-metrics:** 是对JVM指标的埋点, 如果不需要这些配置项可以将其删除或者设置为false。
-- **aggregation:** 针对指标数据的聚合处理使监控指标更平滑。
-- **prometheus-exporter:** 指标数据导出器,这里配置指标服务的端口号为20888。
-
-配置完成后即可启动服务。
-
-### 指标获取
-
-前面的例子中提供了指标服务,接下来我们可以通过普罗米修斯来获取数据。
-普罗米修斯监控服务通过访问:`http://localhost:20888` 即可拉取数据
-指标数据如下所示:
-
-
-普罗米修斯获取数据的配置参考如下:
-```yaml
-# A scrape configuration containing exactly one endpoint to scrape:
-# Here it's Prometheus itself.
-scrape_configs:
- # The job name is added as a label `job=<job_name>` to any timeseries
scraped from this config.
- - job_name: 'prometheus'
-
- # metrics_path defaults to '/metrics'
- # scheme defaults to 'http'.
- - job_name: 'dubbo'
- static_configs:
- - targets: ['IP:20888']
+## 查看 Grafana 可视化面板
+
+示例程序启动后会自动模拟服务调用,只需等待一会能在 Grafana 中可视化的看到 Metrics 指标。
+1. 如果是通过 [Dubbo 控制面](../../../reference/admin/architecture/) 安装的 Grafana,则可以访问
Admin 控制台并在左侧菜单中找到 Grafana 可视化监控入口
+
+2. 如果是独立安装的 Grafana 组件,则可以直接访问 Grafana 可视化控制台地址:
+
+```sh
+$ kubectl port-forward service/grafana 3000:3000
```
-当然在实际企业应用中这个服务发现的地址并不会使用这个静态配置,需要改成动态配置。
+在浏览器打开 Grafana 控制台:http://localhost:3000
+
+### 服务统计视图
+支持基于应用、实例粒度的统计视图,同时对于每一种指标统计粒度,你还可以进一步查看:
-也可以使用普罗米修斯的图形界面来查询指标数据如下图所示:
-
+1. 提供者流量视图
-### 可视化页面
-也可以使用 Grafana可视化指标监测,下面以Grafana可视化为例:
-Dubbo可观测性面板可以在Grafana官网的模板库中可以找到,您可以直接导入如下模版,并配置好数据源即可。
-[https://grafana.com/grafana/dashboards/18051](https://grafana.com/grafana/dashboards/18051)
+
+2. 消费者流量视图

+
+3. 注册中心视图
+
+TBD
+
+4. 配置中心视图
+
+TBD
+
+### JVM 实例视图
+

+
+### 关于 Dubbo 官方提供的 Grafana Dashboard
+
+Dubbo 提供了丰富的指标面板,以上视图面板均可以在 Grafana 官方面板库中找到:您可以直接导入如下模版,并配置好数据源即可。
+
+**Apache Dubbo Observability Dashboard:**
[https://grafana.com/grafana/dashboards/18051](https://grafana.com/grafana/dashboards/18051)
+
+**JVM (Micrometer) Dashboard:**
[https://grafana.com/grafana/dashboards/4701](https://grafana.com/grafana/dashboards/4701)
diff --git a/content/zh-cn/overview/tasks/observability/prometheus.md
b/content/zh-cn/overview/tasks/observability/prometheus.md
index 148fa43df2..8aee6563e9 100644
--- a/content/zh-cn/overview/tasks/observability/prometheus.md
+++ b/content/zh-cn/overview/tasks/observability/prometheus.md
@@ -6,73 +6,40 @@ linkTitle: Prometheus
no_list: true
title: 从 Prometheus 查询 Metrics 监控指标
type: docs
-weight: 3
+weight: 30
---
+## 准备条件
+本文演示如何在 Kubernetes 环境下部署 Prometheus 并实现对 Dubbo 集群的监控数据统计与查询,你需要完成或具备以下内容:
-## 准备条件
-本文演示在如何 Kubernetes 环境下部署的 Prometheus 并实现对 Dubbo 集群的监控数据统计与查询,你需要完成或具备以下内容:
* 本地或远端 Kubernetes 集群
-* Kubernetes 集群安装 Prometheus
-* 部署示例应用
+* 确保 [Prometheus 正确安装](../../../reference/integrations/prometheus#kubernetes)
+* 部署
[示例应用](https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-spring-boot)
* 使用 Prometheus dashboard 查询数据指标
-## 部署与安装 Prometheus
-### Kubernetes 环境安装
-使用以下 Dubbo 社区准备好的 Prometheus 配置文件,可以快速的将 Prometheus 启动起来:
-
-```sh
-$ kubectl apply -f dubbo-stack/prometheus.yaml
-```
+## 确保 Prometheus 正确运行
验证 Prometheus 已经正确部署
-```yaml
-$ kubectl get svc prometheus -n dubbo-system
-```
-
-### 配置 Prometheus
-
-Dubbo 的每个实例都会暴露一个 http 端口用于 Metrics 采集,Prometheus 通过 scraping 每个实例的 http
接口来采集统计数据。具体的 scraping 路径可以通过 Prometheus 配置文件进行调整,该文件控制 scraping 实例的端口、路径、TLS
设置等。
-
-本示例基于 `prometheus.io` 注解实现了 scraping target 地址的自动发现,具体注解配置可参见示例中的 Deployment
资源定义。在此模式下,Dubbo 实例默认提供的 Prometheus Metrics 采集路径是:`20888/management/prometheus`。
-
-> 用户还可以自定义安装 Prometheus。此时,需要正确配置 Prometheus scraping 的目标动态地址路径,我们推荐配合 Dubbo
Admin 作为 Prometheus 地址发现的目标地址,具体请参见 [【Dubbo 生态集成】-【Prometheus
安装】](../../../reference/integrations/prometheus/)。
-
-## 部署示例项目
-接下来,部署示例项目以模拟产生调用数据。完整的示例地址请在此查看
[dubbo-samples-metrics-spring-boot](https://github.com/apache/dubbo-samples/tree/master/4-governance/dubbo-samples-metrics-spring-boot)
-
-**1. 下载示例源码**
```yaml
-$ git clone https://github.com/apache/dubbo-samples.git
+kubectl -n dubbo-system get svc prometheus
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+prometheus ClusterIP 10.109.160.254 <none> 9090/TCP 4m
```
-**2. 部署示例**
-
-```yaml
-$ cd dubbo-samples/4-governance/dubbo-samples-metrics-spring-boot/deploy/k8s
-$ kubectl apply -f ./
-```
-
-**3. 查看示例启动成功**
-```yaml
-$ kubectl get pods -n dubbo-demo
-```
-
-Dubbo 服务开始模拟正常运行,接下来可以通过 Prometheus 查看统计数据了。
-
## 查询 Prometheus
获得 Prometheus dashboard 访问地址
+
```yaml
-$ kubectl port-forward service/prometheus ${port}:${port}
+$ kubectl port-forward service/prometheus 9090:9090
```
+打开浏览器,访问 localhost:9090/graph 即可打开 Prometheus 控制台。
+
接下来,执行 Prometheus 查询命令。可以在此确认 [Dubbo 支持的 Metrics
指标](../../../reference/proposals/metrics/)。
-**1. 在 “Expression” 一览,输入 `dubbo_requests_total`,返回以下结果**
+**1. 在 “Expression” 一览,输入 `dubbo_consumer_qps_total`,返回以下结果**

-
-**2. 在 “Expression” 一览,输入 `dubbo_requests_total`,返回以下结果**