This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng 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 119844d Update observability document (#13417)
119844d is described below
commit 119844d74ae62ba68e2aecd0402a1e529e4bb988
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Nov 2 22:12:54 2021 +0800
Update observability document (#13417)
* Update agent document
* Update observability's concept
---
.../content/features/observability/_index.cn.md | 23 ++++++
.../content/features/observability/_index.en.md | 27 +++++++
.../content/features/observability/agent.cn.md | 82 ----------------------
.../content/features/observability/agent.en.md | 81 ---------------------
.../content/features/observability/concept.cn.md | 19 +++++
.../content/features/observability/concept.en.md | 21 ++++++
.../usage/observability/_index.cn.md | 7 ++
.../usage/observability/_index.en.md | 7 ++
.../usage/observability/agent.cn.md | 75 ++++++++++++++++++++
.../usage/observability/agent.en.md | 75 ++++++++++++++++++++
.../usage}/observability/apm-integration.cn.md | 28 ++------
.../usage}/observability/apm-integration.en.md | 29 +-------
12 files changed, 262 insertions(+), 212 deletions(-)
diff --git a/docs/document/content/features/observability/_index.cn.md
b/docs/document/content/features/observability/_index.cn.md
index 277193f..a8628e3 100644
--- a/docs/document/content/features/observability/_index.cn.md
+++ b/docs/document/content/features/observability/_index.cn.md
@@ -12,6 +12,29 @@ chapter = true
可观察性和遥测是分布式系统推荐的运维方式。
APM(应用性能监控)和 Metrics(统计指标监控)是系统运行状况和健康度的重要可观察性指标。
+APM 是应用性能监控的缩写。
+主要功能着眼于分布式系统的性能诊断,包括调用链展示,应用拓扑分析等。
+
+Apache ShardingSphere 并不负责如何采集、存储以及展示应用性能监控的相关数据,而是将 SQL 解析与 SQL
执行这两块数据分片的最核心的相关信息发送至应用性能监控系统,并交由其处理。
+换句话说,Apache ShardingSphere 仅负责产生具有价值的数据,并通过标准协议递交至相关系统,可通过三种方式对接应用性能监控系统。
+
+- 使用 OpenTracing API 发送性能追踪数据
+
+面向 OpenTracing 协议的 APM 产品都可以与 Apache ShardingSphere 自动对接,比如 SkyWalking,Zipkin
和 Jaeger。
+使用这种方式只需要在启动时配置 OpenTracing 协议的实现者即可。
+它的优点是可以兼容所有的与 OpenTracing 协议兼容的产品作为 APM 的展现系统,如果采用公司愿意实现自己的 APM 系统,也只需要实现
OpenTracing 协议,即可自动展示 Apache ShardingSphere 的链路追踪信息。
+缺点是 OpenTracing 协议发展并不稳定,较新的版本实现者较少,且协议本身过于中立,对于个性化的相关产品的实现不如原生支持强大。
+
+- 使用 OpenTelemetry 发送性能追踪数据
+OpenTelemetry 在2019年由 OpenTracing 和 OpenCencus 合并而来。
+使用这种方式,只需要在agent配置文件中,根据 [OpenTelemetry
SDK自动配置说明](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure)
,填写合适的配置即可。
+
+- 使用 SkyWalking 的自动探针
+
+[Apache ShardingSphere](https://shardingsphere.apache.org) 团队与[Apache
SkyWalking](https://skywalking.apache.org) 团队共同合作,在 SkyWalking 中实现了 Apache
ShardingSphere 自动探针,可以将相关的应用性能数据自动发送到 SkyWalking 中。
+
+Metrics 则用于收集和展示整个集群的统计指标。
+
## 挑战
APM 和 Metrics 需要通过埋点来收集系统信息。
diff --git a/docs/document/content/features/observability/_index.en.md
b/docs/document/content/features/observability/_index.en.md
index 89472b1..d043dae 100644
--- a/docs/document/content/features/observability/_index.en.md
+++ b/docs/document/content/features/observability/_index.en.md
@@ -12,6 +12,33 @@ The point-to-point operation mode of logging in to a
specific server cannot suit
Observability and telemetry are the recommended operation way for them.
APM (application performance monitoring) and metrics (statistical indicator
monitoring) are important system health indicators.
+APM is the abbreviation for application performance monitoring.
+It works for performance diagnosis of distributed systems, including chain
demonstration, application topology analysis and so on.
+
+Apache ShardingSphere is not responsible for gathering, storing and
demonstrating APM data, but sends the core information of SQL parsing and
enforcement to APM to process.
+In other words, Apache ShardingSphere is only responsible for generating
valuable data and submitting it to relevant systems through standard protocol.
+It can connect to APM systems in 3 ways.
+
+- Use OpenTracing API
+
+APM products facing OpenTracing protocol can all automatically connect to
Apache ShardingSphere, like SkyWalking, Zipkin and Jaeger.
+In this way, users only need to configure the implementation of OpenTracing
protocol at the start.
+Its advantage is the compatibility of all the products compatible of
OpenTracing protocol, such as the APM demonstration system.
+If companies intend to implement their own APM systems, they only need to
implement the OpenTracing protocol, and they can automatically show the chain
tracing information of Apache ShardingSphere.
+Its disadvantage is that OpenTracing protocol is not stable in its
development, has only a few new versions, and is too neutral to support
customized products as native ones do.
+
+- Use OpenTelemetry API
+
+OpenTelemetry was merged by OpenTracing and OpenCencus in 2019.
+In this way, you only need to fill in the appropriate configuration in the
agent configuration file according to [OpenTelemetry SDK Autoconfigure
Guide](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure).
+
+- Use SkyWalking's automatic monitor agent
+
+Cooperating with [Apache SkyWalking](https://skywalking.apache.org/) team,
+Apache ShardingSphere team has realized `ShardingSphere` automatic monitor
agent to automatically send application performance data to `SkyWalking`.
+
+Metrics used to collect and display statistical indicator of cluster.
+
## Challenges
APM and metrics need to collect system information through event tracking.
diff --git a/docs/document/content/features/observability/agent.cn.md
b/docs/document/content/features/observability/agent.cn.md
deleted file mode 100644
index bf6c0d4..0000000
--- a/docs/document/content/features/observability/agent.cn.md
+++ /dev/null
@@ -1,82 +0,0 @@
-+++
-title = "Agent集成"
-weight = 2
-+++
-
-## 背景
-
-ShardingSphere-Agent
是独立自主设计,基于`Bytebuddy`字节码增加的项目,基于插件化的设计,可以无缝隙的与ShardingSphere集成,
-
-目前有提供 Log, metrics, APM 等可观测性功能。
-
-## 使用方法
-
-### 本地构建
-
-```
- > cd shardingsphere/shardingsphere-agent
- > mvn clean install
-```
-
-### 远程下载(暂未发布)
-
-```
- > weget http://xxxxx/shardingsphere-agent.tar.gz
- > tar -zxvcf shardingsphere-agent.tar.gz
-```
-
-启动时添加参数
-
-```
--javaagent:\absolute path\shardingsphere-agent.jar
-```
-
-## Agent配置
-
-在本地打包目录和解压缩目录下找到: `agent.yaml`
-
-```yaml
-applicationName: shardingsphere-agent # 应用名称
-ignoredPluginNames: #忽略的插件集合,表示集合里面的插件不生效
- - Opentracing
- - Jaeger
- - Zipkin
- - Prometheus
- - OpenTelemetry
- - Logging
-
-plugins:
- Prometheus:
- host: "localhost" #prometheus暴露的host
- port: 9090 #prometheus暴露的端口
- props:
- JVM_INFORMATION_COLLECTOR_ENABLED : "true"
- Jaeger:
- host: "localhost" #jaeger服务的host
- port: 5775 #jaeger服务的端口
- props:
- SERVICE_NAME: "shardingsphere-agent"
- JAEGER_SAMPLER_TYPE: "const"
- JAEGER_SAMPLER_PARAM: "1"
- JAEGER_REPORTER_LOG_SPANS: "true"
- JAEGER_REPORTER_FLUSH_INTERVAL: "1"
- Zipkin:
- host: "localhost" #zipkin服务的host
- port: 9411 #zipkin服务的prot
- props:
- SERVICE_NAME: "shardingsphere-agent"
- URL_VERSION: "/api/v2/spans" #zipkin服务的抓取span的uri
- Opentracing:
- props:
- OPENTRACING_TRACER_CLASS_NAME:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
- OpenTelemetry:
- props:
- otel.resource.attributes: "service.name=shardingsphere-agent"
#opentelemetry的Resource信息,多个配置可用','分隔
- otel.traces.exporter: "zipkin" #traces数据的导出器
- Logging:
- props:
- LEVEL: "INFO" #打印的日志级别
-
-```
-
-以上为agent的所有配置,注意:当配置 ignoredPluginNames时候,表示集合里面的插件会被忽略!
\ No newline at end of file
diff --git a/docs/document/content/features/observability/agent.en.md
b/docs/document/content/features/observability/agent.en.md
deleted file mode 100644
index 7ba5512..0000000
--- a/docs/document/content/features/observability/agent.en.md
+++ /dev/null
@@ -1,81 +0,0 @@
-+++
-title = "Agent Integration"
-weight = 2
-+++
-
-## Background
-
-ShardingSphere-Agent is an independent and independently designed project
based on ByteBuddy bytecode increase. Based on plugin design, it can integrate
seamlessly with ShardingSphere.
-There are currently Log, metrics, APM and other observability capabilities
available.
-
-## Usage
-
-### Local build
-
-```
- > cd shardingsphere/shardingsphere-agent
- > mvn clean install
-```
-
-### Remote download(No release)
-
-```
- > weget http://xxxxx/shardingsphere-agent.tar.gz
- > tar -zxvcf shardingsphere-agent.tar.gz
-```
-
-Add startup arguments
-
-```
--javaagent:\absolute path\shardingsphere-agent.jar
-```
-
-## Agent Configuration
-
-It is found under the local package directory and unzip directory :
`agent.yaml`
-
-```yaml
-applicationName: shardingsphere-agent # application name
-ignoredPluginNames: # A collection of ignored plugins, indicating that the
plugins in the collection are not active
- - Opentracing
- - Jaeger
- - Zipkin
- - Prometheus
- - OpenTelemetry
- - Logging
-
-plugins:
- Prometheus:
- host: "localhost" #prometheus host
- port: 9090 #prometheus port
- props:
- JVM_INFORMATION_COLLECTOR_ENABLED : "true"
- Jaeger:
- host: "localhost" #jaeger host
- port: 5775 #jaeger prot
- props:
- SERVICE_NAME: "shardingsphere-agent"
- JAEGER_SAMPLER_TYPE: "const"
- JAEGER_SAMPLER_PARAM: "1"
- JAEGER_REPORTER_LOG_SPANS: "true"
- JAEGER_REPORTER_FLUSH_INTERVAL: "1"
- Zipkin:
- host: "localhost" #zipkin host
- port: 9411 #zipkin prot
- props:
- SERVICE_NAME: "shardingsphere-agent"
- URL_VERSION: "/api/v2/spans" #zipkin uri
- Opentracing:
- props:
- OPENTRACING_TRACER_CLASS_NAME:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
- OpenTelemetry:
- props:
- otel.resource.attributes: "service.name=shardingsphere-agent" #Resource
information of opentelemetry, multiple configurations can be separated by ','
- otel.traces.exporter: "zipkin" #the exporter of traces
- Logging:
- props:
- LEVEL: "INFO" #log level
-
-```
-
- When ignoredPluginNames is configured, plugins in the collection are ignored!
\ No newline at end of file
diff --git a/docs/document/content/features/observability/concept.cn.md
b/docs/document/content/features/observability/concept.cn.md
new file mode 100644
index 0000000..b198fc6
--- /dev/null
+++ b/docs/document/content/features/observability/concept.cn.md
@@ -0,0 +1,19 @@
++++
+title = "核心概念"
+weight = 1
++++
+
+## 探针
+
+基于字节码增强和插件化设计提供 APM 和 metrics 埋点,以及日志输出功能。
+需要开启探针后,才能将监控指标数据输出至 第三方 APM 中展示。
+
+## APM
+
+APM 是应用性能监控的缩写。
+着眼于分布式系统的性能诊断,其主要功能包括调用链展示,应用拓扑分析等。
+通过探针发送调用链数据至第三方 APM 协议。
+
+## Metrics
+
+系统统计指标,通过探针收集,并且写入到时序数据库,供第三方应用展示。
diff --git a/docs/document/content/features/observability/concept.en.md
b/docs/document/content/features/observability/concept.en.md
new file mode 100644
index 0000000..8ba2d8b
--- /dev/null
+++ b/docs/document/content/features/observability/concept.en.md
@@ -0,0 +1,21 @@
++++
+title = "Core Concept"
+weight = 1
++++
+
+## Agent
+
+Based on bytecode enhance and plugin design to provide APM, metrics event
tracing and log output.
+Enable agent to collection data and then can display data into integrated 3rd
APM projects.
+
+## APM
+
+APM is the abbreviation for application performance monitoring.
+It works for performance diagnosis of distributed systems, including chain
demonstration, application topology analysis and so on.
+Use agent to send tracing data into 3rd party APM protocols.
+
+## Metrics
+
+System statistical indicator which collected from agent.
+Write to time series databases periodically.
+3rd party UI can display the metrics data simply.
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.cn.md
new file mode 100644
index 0000000..5f993e0
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.cn.md
@@ -0,0 +1,7 @@
++++
+title = "可观察性"
+weight = 4
+chapter = true
++++
+
+介绍如何使用可观察性探针和集成第三方应用。
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.en.md
new file mode 100644
index 0000000..01dd7c4
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/_index.en.md
@@ -0,0 +1,7 @@
++++
+title = "Observability"
+weight = 4
+chapter = true
++++
+
+Introduce how to use agent and integrate 3rd party with observability.
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.cn.md
new file mode 100644
index 0000000..a6bd57a
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.cn.md
@@ -0,0 +1,75 @@
++++
+title = "使用探针"
+weight = 1
++++
+
+## 如何获取
+
+### 本地构建
+
+```
+ > cd shardingsphere/shardingsphere-agent
+ > mvn clean install
+```
+
+### 远程下载(暂未发布)
+
+```
+ > weget http://xxxxx/shardingsphere-agent.tar.gz
+ > tar -zxvcf shardingsphere-agent.tar.gz
+```
+
+## 配置
+
+找到 `agent.yaml` 文件:
+
+```yaml
+applicationName: shardingsphere-agent
+ignoredPluginNames: # 忽略的插件集合
+ - Opentracing
+ - Jaeger
+ - Zipkin
+ - Prometheus
+ - OpenTelemetry
+ - Logging
+
+plugins:
+ Prometheus:
+ host: "localhost"
+ port: 9090
+ props:
+ JVM_INFORMATION_COLLECTOR_ENABLED : "true"
+ Jaeger:
+ host: "localhost"
+ port: 5775
+ props:
+ SERVICE_NAME: "shardingsphere-agent"
+ JAEGER_SAMPLER_TYPE: "const"
+ JAEGER_SAMPLER_PARAM: "1"
+ JAEGER_REPORTER_LOG_SPANS: "true"
+ JAEGER_REPORTER_FLUSH_INTERVAL: "1"
+ Zipkin:
+ host: "localhost"
+ port: 9411
+ props:
+ SERVICE_NAME: "shardingsphere-agent"
+ URL_VERSION: "/api/v2/spans"
+ Opentracing:
+ props:
+ OPENTRACING_TRACER_CLASS_NAME:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
+ OpenTelemetry:
+ props:
+ otel.resource.attributes: "service.name=shardingsphere-agent" #
多个配置用','分隔
+ otel.traces.exporter: "zipkin"
+ Logging:
+ props:
+ LEVEL: "INFO"
+```
+
+## 启动
+
+在启动脚本中添加参数:
+
+```
+-javaagent:\absolute path\shardingsphere-agent.jar
+```
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.en.md
new file mode 100644
index 0000000..7526268
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/agent.en.md
@@ -0,0 +1,75 @@
++++
+title = "Use Agent"
+weight = 1
++++
+
+## Build
+
+### Local Build
+
+```
+ > cd shardingsphere/shardingsphere-agent
+ > mvn clean install
+```
+
+### Download(Not Released Yet)
+
+```
+ > weget http://xxxxx/shardingsphere-agent.tar.gz
+ > tar -zxvcf shardingsphere-agent.tar.gz
+```
+
+## Configuration
+
+Found `agent.yaml` file:
+
+```yaml
+applicationName: shardingsphere-agent
+ignoredPluginNames: # A collection of ignored plugins
+ - Opentracing
+ - Jaeger
+ - Zipkin
+ - Prometheus
+ - OpenTelemetry
+ - Logging
+
+plugins:
+ Prometheus:
+ host: "localhost"
+ port: 9090
+ props:
+ JVM_INFORMATION_COLLECTOR_ENABLED : "true"
+ Jaeger:
+ host: "localhost"
+ port: 5775
+ props:
+ SERVICE_NAME: "shardingsphere-agent"
+ JAEGER_SAMPLER_TYPE: "const"
+ JAEGER_SAMPLER_PARAM: "1"
+ JAEGER_REPORTER_LOG_SPANS: "true"
+ JAEGER_REPORTER_FLUSH_INTERVAL: "1"
+ Zipkin:
+ host: "localhost"
+ port: 9411
+ props:
+ SERVICE_NAME: "shardingsphere-agent"
+ URL_VERSION: "/api/v2/spans"
+ Opentracing:
+ props:
+ OPENTRACING_TRACER_CLASS_NAME:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
+ OpenTelemetry:
+ props:
+ otel.resource.attributes: "service.name=shardingsphere-agent" # Multiple
configurations can be split by ','
+ otel.traces.exporter: "zipkin"
+ Logging:
+ props:
+ LEVEL: "INFO"
+```
+
+## Startup
+
+Add arguments in startup script.
+
+```
+-javaagent:\absolute path\shardingsphere-agent.jar
+```
diff --git a/docs/document/content/features/observability/apm-integration.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.cn.md
similarity index 52%
rename from docs/document/content/features/observability/apm-integration.cn.md
rename to
docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.cn.md
index 4603bdf..76e5ef7 100644
--- a/docs/document/content/features/observability/apm-integration.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.cn.md
@@ -1,26 +1,8 @@
+++
title = "应用性能监控集成"
-weight = 1
+weight = 2
+++
-## 背景
-
-APM 是应用性能监控的缩写。目前 APM 的主要功能着眼于分布式系统的性能诊断,其主要功能包括调用链展示,应用拓扑分析等。
-
-Apache ShardingSphere 并不负责如何采集、存储以及展示应用性能监控的相关数据,而是将 SQL 解析与 SQL
执行这两块数据分片的最核心的相关信息发送至应用性能监控系统,并交由其处理。
-换句话说,Apache ShardingSphere 仅负责产生具有价值的数据,并通过标准协议递交至相关系统。Apache ShardingSphere
可以通过三种方式对接应用性能监控系统。
-
-第一种方式是使用 OpenTracing API 发送性能追踪数据。面向 OpenTracing 协议的 APM 产品都可以与 Apache
ShardingSphere 自动对接,比如 SkyWalking,Zipkin 和 Jaeger。
-使用这种方式只需要在启动时配置 OpenTracing 协议的实现者即可。
-它的优点是可以兼容所有的与 OpenTracing 协议兼容的产品作为 APM 的展现系统,如果采用公司愿意实现自己的 APM 系统,也只需要实现
OpenTracing 协议,即可自动展示 Apache ShardingSphere 的链路追踪信息。
-缺点是 OpenTracing 协议发展并不稳定,较新的版本实现者较少,且协议本身过于中立,对于个性化的相关产品的实现不如原生支持强大。
-
-第二种方式是使用 SkyWalking 的自动探针。
-[Apache ShardingSphere](https://shardingsphere.apache.org) 团队与[Apache
SkyWalking](https://skywalking.apache.org) 团队共同合作,在 SkyWalking 中实现了 Apache
ShardingSphere 自动探针,可以将相关的应用性能数据自动发送到 SkyWalking 中。
-
-第三种方式是使用 OpenTelemetry 发送性能追踪数据。OpenTelemetry 在2019年由 OpenTracing 和 OpenCencus
合并而来。
-使用这种方式,只需要在agent配置文件中,根据 [OpenTelemetry
SDK自动配置说明](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure)
,填写合适的配置即可。
-
## 使用方法
### 使用 OpenTracing 协议
@@ -39,13 +21,13 @@ Apache ShardingSphere 并不负责如何采集、存储以及展示应用性能
ShardingTracer.init();
```
-* 方法2:通过参数注入APM系统提供的 Tracer 实现类
+* 方法2:通过参数注入APM系统提供的 Tracer 实现类。
```java
ShardingTracer.init(new SkywalkingTracer());
```
-*注意:使用 SkyWalking 的 OpenTracing 探针时,应将原 Apache ShardingSphere
探针插件禁用,以防止两种插件互相冲突*
+*注意:使用 SkyWalking 的 OpenTracing 探针时,应将原 Apache ShardingSphere
探针插件禁用,以防止两种插件互相冲突。*
### 使用 SkyWalking 自动探针
@@ -53,7 +35,7 @@ ShardingTracer.init(new SkywalkingTracer());
### 使用 OpenTelemetry
-在agent.yaml中填写好配置即可,例如将 Traces 数据导出到 Zipkin 。
+在agent.yaml中填写好配置即可,例如将 Traces 数据导出到 Zipkin。
```yaml
OpenTelemetry:
@@ -69,7 +51,7 @@ OpenTelemetry:
### 应用架构
-使用 ShardingSphere-Proxy
访问两个数据库`192.168.0.1:3306`和`192.168.0.2:3306`,且每个数据库中有两个分表。
+使用 ShardingSphere-Proxy 访问两个数据库`192.168.0.1:3306` 和
`192.168.0.2:3306`,且每个数据库中有两个分表。
### 拓扑图展示
diff --git a/docs/document/content/features/observability/apm-integration.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.en.md
similarity index 56%
rename from docs/document/content/features/observability/apm-integration.en.md
rename to
docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.en.md
index 3f23591..bb5c28a 100644
--- a/docs/document/content/features/observability/apm-integration.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/observability/apm-integration.en.md
@@ -1,31 +1,8 @@
+++
title = "APM Integration"
-weight = 1
+weight = 2
+++
-## Background
-
-APM is the abbreviation for application performance monitoring.
-Currently, main APM functions lie in the performance diagnosis of distributed
systems, including chain demonstration, application topology analysis and so on.
-
-Apache ShardingSphere is not responsible for gathering, storing and
demonstrating APM data, but sends the core information of SQL parsing and
enforcement to APM to process.
-In other words, Apache ShardingSphere is only responsible for generating
valuable data and submitting it to relevant systems through standard protocol.
-It can connect to APM systems in three ways.
-
-The first way is to send performance tracing data by OpenTracing API.
-APM products facing OpenTracing protocol can all automatically connect to
Apache ShardingSphere, like SkyWalking, Zipkin and Jaeger.
-In this way, users only need to configure the implementation of OpenTracing
protocol at the start.
-Its advantage is the compatibility of all the products compatible of
OpenTracing protocol, such as the APM demonstration system.
-If companies intend to implement their own APM systems, they only need to
implement the OpenTracing protocol, and they can automatically show the chain
tracing information of Apache ShardingSphere.
-Its disadvantage is that OpenTracing protocol is not stable in its
development, has only a few new versions, and is too neutral to support
customized products as native ones do.
-
-The second way is to use SkyWalking's automatic monitor agent.
-Cooperating with [Apache SkyWalking](https://skywalking.apache.org/) team,
-Apache ShardingSphere team has realized `ShardingSphere` automatic monitor
agent to automatically send application performance data to `SkyWalking`.
-
-The third way is to send performance tracing data by OpenTelemetry.
OpenTelemetry was merged by OpenTracing and OpenCencus in 2019.
-In this way, you only need to fill in the appropriate configuration in the
agent configuration file according to [OpenTelemetry SDK Autoconfigure
Guide](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure).
-
## Usage
### Use OpenTracing
@@ -38,13 +15,13 @@ Add startup arguments
-Dorg.apache.shardingsphere.tracing.opentracing.tracer.class=org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer
```
-Call initialization method
+Call initialization method.
```java
ShardingTracer.init();
```
-* Method 2: inject Tracer provided by APM through parameter
+* Method 2: inject Tracer provided by APM through parameter.
```java
ShardingTracer.init(new SkywalkingTracer());