You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/07/31 05:55:23 UTC

[shardingsphere] branch master updated: Moved Observability's manual to Proxy. (#19717)

This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 40606235a64 Moved Observability's manual to Proxy. (#19717)
40606235a64 is described below

commit 40606235a64f579890099dd526fe8a8713f78d3d
Author: Raigor <ra...@gmail.com>
AuthorDate: Sun Jul 31 13:55:17 2022 +0800

    Moved Observability's manual to Proxy. (#19717)
---
 .../document/content/features/distsql/_index.cn.md |  4 +-
 .../document/content/features/distsql/_index.en.md |  4 +-
 .../content/features/observability/_index.cn.md    |  4 +-
 .../content/features/observability/_index.en.md    |  4 +-
 .../shardingsphere-proxy/logging/_index.cn.md      | 58 ----------------------
 .../shardingsphere-proxy/logging/_index.en.md      | 55 --------------------
 .../observability/_index.cn.md}                    | 51 +++++++++----------
 .../observability/_index.en.md}                    | 53 +++++++++-----------
 .../shardingsphere-proxy/scaling/_index.cn.md      |  2 +-
 .../shardingsphere-proxy/scaling/_index.en.md      |  2 +-
 10 files changed, 56 insertions(+), 181 deletions(-)

diff --git a/docs/document/content/features/distsql/_index.cn.md b/docs/document/content/features/distsql/_index.cn.md
index ed618c3a7fa..e2263a40385 100644
--- a/docs/document/content/features/distsql/_index.cn.md
+++ b/docs/document/content/features/distsql/_index.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.12. </b>"
+pre = "<b>3.11. </b>"
 title = "DistSQL"
-weight = 12
+weight = 11
 +++
 
 ## 定义
diff --git a/docs/document/content/features/distsql/_index.en.md b/docs/document/content/features/distsql/_index.en.md
index 85f813d081e..c924b243782 100644
--- a/docs/document/content/features/distsql/_index.en.md
+++ b/docs/document/content/features/distsql/_index.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.12. </b>"
+pre = "<b>3.11. </b>"
 title = "DistSQL"
-weight = 12
+weight = 11
 +++
 
 ## Definition
diff --git a/docs/document/content/features/observability/_index.cn.md b/docs/document/content/features/observability/_index.cn.md
index 7790e1951c3..cb9e10349a4 100644
--- a/docs/document/content/features/observability/_index.cn.md
+++ b/docs/document/content/features/observability/_index.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.11. </b>"
+pre = "<b>3.12. </b>"
 title = "可观察性"
-weight = 11
+weight = 12
 +++
 
 ## 定义
diff --git a/docs/document/content/features/observability/_index.en.md b/docs/document/content/features/observability/_index.en.md
index 742be66d544..cd29a5ecce8 100644
--- a/docs/document/content/features/observability/_index.en.md
+++ b/docs/document/content/features/observability/_index.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.11. </b>"
+pre = "<b>3.12. </b>"
 title = "Observability"
-weight = 11
+weight = 12
 +++
 
 ## Definition
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.cn.md
deleted file mode 100644
index a4908efb9b3..00000000000
--- a/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.cn.md
+++ /dev/null
@@ -1,58 +0,0 @@
-+++
-title = "Logging"
-weight = 4
-+++
-
-本章将介绍日志记录的详细语法,当使用者需要在日志中区分 database 或用户时,可以在 logback.xml 中添加以下配置。
-
-## 区分同一日志中的 database
-
-```
-<appender name="databaseConsole" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-        <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{database}] %logger{36} - %msg%n</pattern>
-    </encoder>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="databaseConsole" />
-</logger>
-```
-
-## 区分同一日志中的 database 和用户
-
-```
-<appender name="databaseConsole" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-        <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{database}] [%X{user}] %logger{36} - %msg%n</pattern>
-    </encoder>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="databaseConsole" />
-</logger>
-```
-
-## 拆分为不同的日志文件
-
-```
-<appender name="SiftingFile" class="ch.qos.logback.classic.sift.SiftingAppender">
-    <discriminator>
-        <key>database</key>
-        <defaultValue>none</defaultValue>
-    </discriminator>
-    <sift>
-        <appender name="File-${database}" class="ch.qos.logback.core.FileAppender">
-            <file>logs/${database}.log</file>
-            <append>true</append>
-            <encoder charset="UTF-8">
-                <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{user}] %logger{36} - %msg%n</pattern>
-            </encoder>
-        </appender>
-    </sift>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="SiftingFile" />
-</logger>
-```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.en.md
deleted file mode 100644
index 7975d5bd4f7..00000000000
--- a/docs/document/content/user-manual/shardingsphere-proxy/logging/_index.en.md
+++ /dev/null
@@ -1,55 +0,0 @@
-+++
-title = "Logging"
-weight = 4
-+++
-
-This chapter will introduce the detailed syntax of Logging which is used when users need to distinguish databases or users in the log. To achieve a specific goal, following configurations can be added to logback.xml:
-
-## To distinguish databases in the same log
-```
-<appender name="databaseConsole" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-        <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{database}] %logger{36} - %msg%n</pattern>
-    </encoder>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="databaseConsole" />
-</logger>
-```
-
-## To distinguish databases and users in the same log
-```
-<appender name="databaseConsole" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-        <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{database}] [%X{user}] %logger{36} - %msg%n</pattern>
-    </encoder>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="databaseConsole" />
-</logger>
-```
-
-## To split into different log files
-```
-<appender name="SiftingFile" class="ch.qos.logback.classic.sift.SiftingAppender">
-    <discriminator>
-        <key>database</key>
-        <defaultValue>none</defaultValue>
-    </discriminator>
-    <sift>
-        <appender name="File-${database}" class="ch.qos.logback.core.FileAppender">
-            <file>logs/${database}.log</file>
-            <append>true</append>
-            <encoder charset="UTF-8">
-                <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{user}] %logger{36} - %msg%n</pattern>
-            </encoder>
-        </appender>
-    </sift>
-</appender>
-
-<logger name="ShardingSphere-SQL" level="info" additivity="false">
-    <appender-ref ref="SiftingFile" />
-</logger>
-```
diff --git a/docs/document/content/features/observability/use-norms.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
similarity index 69%
rename from docs/document/content/features/observability/use-norms.cn.md
rename to docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
index 5d8e5969116..d94229f77d6 100644
--- a/docs/document/content/features/observability/use-norms.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
@@ -1,6 +1,6 @@
 +++
-title = "使用规范" 
-weight = 2
+title = "可观察性"
+weight = 5
 +++
 
 ## 源码编译
@@ -22,23 +22,26 @@ tar -zxvf apache-shardingsphere-${latest.release.version}-shardingsphere-agent-b
 cd agent
 tree 
 .
-├── conf
-│   ├── agent.yaml
-│   └── logback.xml
-├── plugins
-│   ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
-│   ├── shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-jaeger-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
-│   └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
-└── shardingsphere-agent.jar
-
+└── apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin
+    ├── LICENSE
+    ├── NOTICE
+    ├── conf
+    │   ├── agent.yaml
+    │   └── logback.xml
+    ├── plugins
+    │   ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-jaeger-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
+    │   └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
+    └── shardingsphere-agent.jar
 ```
 * 配置说明
 
-agent.yaml 是配置文件,插件有 Jaeger、OpenTracing、Zipkin、OpenTelemetry、Logging、Prometheus。
-如果需要开启插件时,只需要注释掉 ignoredPluginNames 中对应的插件即可。
+`conf/agent.yaml` 用于管理 agent 配置。
+内置插件包括 Jaeger、OpenTracing、Zipkin、OpenTelemetry、Logging 及 Prometheus。
+当需要开启插件时,只需要移除 `ignoredPluginNames` 中对应的插件名称即可。
 
 ```yaml
 applicationName: shardingsphere-agent
@@ -98,27 +101,19 @@ plugins:
 | otel.traces.sampler | opentelemetry 采样率类型 | always_on、always_off、traceidratio | always_on |
 | otel.traces.sampler.arg | opentelemetry 采样率参数 | traceidratio:0.0 - 1.0 | 1.0 |
 
-
 ## ShardingSphere-Proxy 中使用
 
-* 启动脚本
+* 编辑启动脚本
 
-  配置 shardingsphere-agent.jar 的绝对路径到 ShardingSphere-Proxy 的 start.sh 启动脚本中,请注意配置自己对应的绝对路径。
+配置 shardingsphere-agent.jar 的绝对路径到 ShardingSphere-Proxy 的 start.sh 启动脚本中,请注意配置自己对应的绝对路径。
 ```shell
 nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
 -javaagent:/xxxxx/agent/shardingsphere-agent.jar \
 -classpath ${CLASS_PATH} ${MAIN_CLASS} >> ${STDOUT_FILE} 2>&1 &
 ```
 
-* 启动插件
-
-通过改造后的 ShardingSphere-Proxy 的启动脚本启动。
+* 启动 ShardingSphere-Proxy
 ```shell
 bin/start.sh
 ```
-正常启动可以在对应的 ShardingSphere-Proxy 日志查看到 plugin 的启动日志,访问 Proxy 后,可以通过配置的地址查看到 Metric 和 Tracing 的数据。
-
-
-
-
-
+正常启动后,可以在 ShardingSphere-Proxy 日志中找到 plugin 的加载信息,访问 Proxy 后,可以通过配置的监控地址查看到 `Metric` 和 `Tracing` 的数据。
diff --git a/docs/document/content/features/observability/use-norms.en.md b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
similarity index 71%
rename from docs/document/content/features/observability/use-norms.en.md
rename to docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
index 2e97d87eaa1..f288ce086b0 100644
--- a/docs/document/content/features/observability/use-norms.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
@@ -1,6 +1,6 @@
 +++
-title = "Use Norms"
-weight = 2
+title = "Observability"
+weight = 5
 +++
 
 ## Compile source code
@@ -22,24 +22,26 @@ tar -zxvf apache-shardingsphere-${latest.release.version}-shardingsphere-agent-b
 cd agent
 tree 
 .
-├── conf
-│   ├── agent.yaml
-│   └── logback.xml
-├── plugins
-│   ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
-│   ├── shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-jaeger-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│   ├── shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
-│   └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
-└── shardingsphere-agent.jar
-
+└── apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin
+    ├── LICENSE
+    ├── NOTICE
+    ├── conf
+    │   ├── agent.yaml
+    │   └── logback.xml
+    ├── plugins
+    │   ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-jaeger-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
+    │   ├── shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
+    │   └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
+    └── shardingsphere-agent.jar
 ```
 * Configuration file
 
-agent.yaml is a configuration file. The plug-ins include Jaeger, opentracing, Zipkin, opentelemetry, logging and Prometheus.
-Remove the corresponding plug-in in ignoredpluginnames to start the plug-in.
-
+`conf/agent.yaml` is used to manage agent configuration.
+Built-in plugins include Jaeger, OpenTracing, Zipkin, OpenTelemetry, Logging and Prometheus.
+When a plugin needs to be enabled, just remove the corresponding name in `ignoredPluginNames`.
 
 ```yaml
 applicationName: shardingsphere-agent
@@ -99,10 +101,9 @@ plugins:
 | otel.traces.sampler | Opentelemetry sample rate type | always_on, always_off, traceidratio | always_on |
 | otel.traces.sampler.arg | Opentelemetry sample rate parameter | traceidratio:0.0 - 1.0 | 1.0 |
 
+## Usage in ShardingSphere-Proxy
 
-## Used in ShardingSphere-Proxy
-
-* Startup script
+* Edit the startup script
 
 Configure the absolute path of shardingsphere-agent.jar to the start.sh startup script of shardingsphere proxy. 
 ```shell
@@ -111,16 +112,8 @@ nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
 -classpath ${CLASS_PATH} ${MAIN_CLASS} >> ${STDOUT_FILE} 2>&1 &
 ```
 
-* Launch plugin
-
+* Start ShardingSphere-Proxy
 ```shell
 bin/start.sh
 ```
-
-After normal startup, you can view the startup log of the plugin in the shardingsphere proxy log, and you can view the data at the configured address.
-
-
-
-
-
-
+After startup, you can find the plugin info in the log of ShardingSphere-Proxy, `Metric` and `Tracing` data can be viewed through the configured monitoring address.
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.cn.md
index 0d69aede590..f7262d339c9 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.cn.md
@@ -1,6 +1,6 @@
 +++
 title = "Scaling"
-weight = 5
+weight = 4
 +++
 
 ## 简介
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.en.md
index f75a90dc877..4dee8cdd987 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/scaling/_index.en.md
@@ -1,6 +1,6 @@
 +++
 title = "Scaling"
-weight = 5
+weight = 4
 +++
 
 ## Introduction