You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2023/01/02 07:30:17 UTC
[shardingsphere] branch master updated: Rename agent-logging-base to agent-logging-file (#23259)
This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 3caa594c6e7 Rename agent-logging-base to agent-logging-file (#23259)
3caa594c6e7 is described below
commit 3caa594c6e79b1a4bd77564ea479a377e088ee52
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon Jan 2 15:30:06 2023 +0800
Rename agent-logging-base to agent-logging-file (#23259)
* Rename agent-logging-base to agent-logging-file
---
agent/core/src/test/resources/conf/agent.yaml | 2 +-
agent/distribution/pom.xml | 2 +-
.../src/main/resources/conf/agent.yaml | 2 +-
agent/plugins/logging/type/{base => file}/pom.xml | 2 +-
.../file/FileLoggingPluginBootService.java} | 8 +--
.../advice/MetaDataContextsFactoryAdvice.java | 2 +-
.../resources/META-INF/conf/file-advisors.yaml} | 0
...ache.shardingsphere.agent.spi.PluginBootService | 2 +-
agent/plugins/logging/type/pom.xml | 2 +-
docs/document/content/dev-manual/agent.cn.md | 2 +-
docs/document/content/dev-manual/agent.en.md | 2 +-
.../observability/_index.cn.md | 71 ++++++++++++---------
.../observability/_index.en.md | 73 +++++++++++++---------
.../test/resources/docker/agent/conf/agent.yaml | 2 +-
.../test/resources/docker/agent/conf/agent.yaml | 2 +-
.../test/resources/docker/agent/conf/agent.yaml | 2 +-
16 files changed, 98 insertions(+), 78 deletions(-)
diff --git a/agent/core/src/test/resources/conf/agent.yaml b/agent/core/src/test/resources/conf/agent.yaml
index 0ed75454ea4..c95d3154707 100644
--- a/agent/core/src/test/resources/conf/agent.yaml
+++ b/agent/core/src/test/resources/conf/agent.yaml
@@ -17,7 +17,7 @@
plugins:
logging:
- BaseLogging:
+ File:
props:
level: "INFO"
metrics:
diff --git a/agent/distribution/pom.xml b/agent/distribution/pom.xml
index 328b0795c51..4753919e537 100644
--- a/agent/distribution/pom.xml
+++ b/agent/distribution/pom.xml
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-agent-logging-base</artifactId>
+ <artifactId>shardingsphere-agent-logging-file</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/agent/distribution/src/main/resources/conf/agent.yaml b/agent/distribution/src/main/resources/conf/agent.yaml
index 271181c381e..e6e1e521e8e 100644
--- a/agent/distribution/src/main/resources/conf/agent.yaml
+++ b/agent/distribution/src/main/resources/conf/agent.yaml
@@ -17,7 +17,7 @@
plugins:
# logging:
-# BaseLogging:
+# File:
# props:
# level: "INFO"
# metrics:
diff --git a/agent/plugins/logging/type/base/pom.xml b/agent/plugins/logging/type/file/pom.xml
similarity index 97%
rename from agent/plugins/logging/type/base/pom.xml
rename to agent/plugins/logging/type/file/pom.xml
index b31ad3efd04..9de18a64007 100644
--- a/agent/plugins/logging/type/base/pom.xml
+++ b/agent/plugins/logging/type/file/pom.xml
@@ -24,7 +24,7 @@
<artifactId>shardingsphere-agent-logging-type</artifactId>
<version>5.3.1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-agent-logging-base</artifactId>
+ <artifactId>shardingsphere-agent-logging-file</artifactId>
<name>${project.artifactId}</name>
<build>
diff --git a/agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/BaseLoggingPluginBootService.java b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/FileLoggingPluginBootService.java
similarity index 86%
rename from agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/BaseLoggingPluginBootService.java
rename to agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/FileLoggingPluginBootService.java
index 7966b1181df..581d8cff7b5 100644
--- a/agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/BaseLoggingPluginBootService.java
+++ b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/FileLoggingPluginBootService.java
@@ -15,15 +15,15 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.agent.plugin.logging.base;
+package org.apache.shardingsphere.agent.plugin.logging.file;
import org.apache.shardingsphere.agent.api.PluginConfiguration;
import org.apache.shardingsphere.agent.spi.PluginBootService;
/**
- * Base logging plugin boot service.
+ * File logging plugin boot service.
*/
-public final class BaseLoggingPluginBootService implements PluginBootService {
+public final class FileLoggingPluginBootService implements PluginBootService {
@Override
public void start(final PluginConfiguration pluginConfig, final boolean isEnhancedForProxy) {
@@ -35,6 +35,6 @@ public final class BaseLoggingPluginBootService implements PluginBootService {
@Override
public String getType() {
- return "BaseLogging";
+ return "File";
}
}
diff --git a/agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/advice/MetaDataContextsFactoryAdvice.java b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
similarity index 96%
rename from agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/advice/MetaDataContextsFactoryAdvice.java
rename to agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
index 1f44af4852b..0f7c6fc295e 100644
--- a/agent/plugins/logging/type/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/advice/MetaDataContextsFactoryAdvice.java
+++ b/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice/MetaDataContextsFactoryAdvice.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.agent.plugin.logging.base.advice;
+package org.apache.shardingsphere.agent.plugin.logging.file.advice;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.agent.api.advice.type.StaticMethodAdvice;
diff --git a/agent/plugins/logging/type/base/src/main/resources/META-INF/conf/baselogging-advisors.yaml b/agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
similarity index 100%
rename from agent/plugins/logging/type/base/src/main/resources/META-INF/conf/baselogging-advisors.yaml
rename to agent/plugins/logging/type/file/src/main/resources/META-INF/conf/file-advisors.yaml
diff --git a/agent/plugins/logging/type/base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService b/agent/plugins/logging/type/file/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService
similarity index 92%
rename from agent/plugins/logging/type/base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService
rename to agent/plugins/logging/type/file/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService
index a8b7db5f850..42e8c971aae 100644
--- a/agent/plugins/logging/type/base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService
+++ b/agent/plugins/logging/type/file/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginBootService
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.agent.plugin.logging.base.BaseLoggingPluginBootService
+org.apache.shardingsphere.agent.plugin.logging.file.FileLoggingPluginBootService
diff --git a/agent/plugins/logging/type/pom.xml b/agent/plugins/logging/type/pom.xml
index ae4adaa3efe..517cd912a3c 100644
--- a/agent/plugins/logging/type/pom.xml
+++ b/agent/plugins/logging/type/pom.xml
@@ -29,7 +29,7 @@
<name>${project.artifactId}</name>
<modules>
- <module>base</module>
+ <module>file</module>
</modules>
<properties>
diff --git a/docs/document/content/dev-manual/agent.cn.md b/docs/document/content/dev-manual/agent.cn.md
index 1f3881de350..7070bc2929b 100644
--- a/docs/document/content/dev-manual/agent.cn.md
+++ b/docs/document/content/dev-manual/agent.cn.md
@@ -20,7 +20,7 @@ chapter = true
| *配置标识* | *详细说明* | *全限定类名* |
| ------------- | --------------------------------- | ---------- |
| Prometheus | Prometheus plugin 启动类 | [`org.apache.shardingsphere.agent.metrics.prometheus.service.PrometheusPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/service/PrometheusPluginBootService.java) |
-| Logging | Logging plugin 启动类 | [`org.apache.shardingsphere.agent.plugin.logging.base.service.BaseLoggingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/service/BaseLoggingPluginBootService.java) |
+| Logging | Logging plugin 启动类 | [`org.apache.shardingsphere.agent.plugin.logging.base.service.FileLoggingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/service/FileLoggingPluginBootService.java) |
| Jaeger | Jaeger plugin 启动类 | [`org.apache.shardingsphere.agent.plugin.tracing.jaeger.service.JaegerTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootService.java) |
| OpenTelemetry | OpenTelemetryTracing plugin 启动类 | [`org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.service.OpenTelemetryTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTelemetryTracingPluginBootService.java) |
| OpenTracing | OpenTracing plugin 启动类 | [`org.apache.shardingsphere.agent.plugin.tracing.opentracing.service.OpenTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/service/OpenTracingPluginBootService.java) |
diff --git a/docs/document/content/dev-manual/agent.en.md b/docs/document/content/dev-manual/agent.en.md
index 83992b70bc1..ca3020ff170 100644
--- a/docs/document/content/dev-manual/agent.en.md
+++ b/docs/document/content/dev-manual/agent.en.md
@@ -20,7 +20,7 @@ Plugin startup service definition
| *Configuration Type* | *Description* | *Fully-qualified class name* |
| -------------------- | ----------------------------------------- | ---------------------------- |
| Prometheus | Prometheus plugin startup class | [`org.apache.shardingsphere.agent.metrics.prometheus.service.PrometheusPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/metrics/prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/service/PrometheusPluginBootService.java) |
-| Logging | Logging plugin startup class | [`org.apache.shardingsphere.agent.plugin.logging.base.service.BaseLoggingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/service/BaseLoggingPluginBootService.java) |
+| Logging | Logging plugin startup class | [`org.apache.shardingsphere.agent.plugin.logging.base.service.FileLoggingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/service/FileLoggingPluginBootService.java) |
| Jaeger | Jaeger plugin startup class | [`org.apache.shardingsphere.agent.plugin.tracing.jaeger.service.JaegerTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootService.java) |
| OpenTelemetry | OpenTelemetryTracing plugin startup class | [`org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.service.OpenTelemetryTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTelemetryTracingPluginBootService.java) |
| OpenTracing | OpenTracing plugin startup class | [`org.apache.shardingsphere.agent.plugin.tracing.opentracing.service.OpenTracingPluginBootService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/service/OpenTracingPluginBootService.java) |
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
index 0bfd6429228..20244ff6f05 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
@@ -4,7 +4,9 @@ weight = 5
+++
## 源码编译
+
从 Github 下载 Apache ShardingSphere 源码,对源码进行编译,操作命令如下。
+
```shell
git clone --depth 1 https://github.com/apache/shardingsphere.git
cd shardingsphere
@@ -13,9 +15,11 @@ mvn clean install -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Drat.skip=tr
agent 包输出目录为 shardingsphere-agent/shardingsphere-agent-distribution/target/apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz
## agent 配置
+
* 目录说明
创建 agent 目录,解压 agent 二进制包到 agent 目录。
+
```shell
mkdir agent
tar -zxvf apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz -C agent
@@ -29,7 +33,7 @@ tree
│ ├── agent.yaml
│ └── logback.xml
├── plugins
- │ ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
+ │ ├── shardingsphere-agent-logging-file-${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
@@ -37,16 +41,17 @@ tree
│ └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
+
* 配置说明
`META-INF/conf/agent.yaml` 用于管理 agent 配置。
-内置插件包括 Jaeger、OpenTracing、Zipkin、OpenTelemetry、BaseLogging 及 Prometheus。
+内置插件包括 Jaeger、OpenTracing、Zipkin、OpenTelemetry、Log 及 Prometheus。
默认不开启任何插件。
```yaml
plugins:
# logging:
-# BaseLogging:
+# File:
# props:
# level: "INFO"
# metrics:
@@ -79,6 +84,7 @@ plugins:
# otel-resource-attributes: "service.name=shardingsphere"
# otel-traces-exporter: "zipkin"
```
+
* 参数说明;
| 名称 | 说明 |取值范围 | 默认值 |
@@ -102,6 +108,7 @@ plugins:
* 编辑启动脚本
配置 shardingsphere-agent-${latest.release.version}.jar 的绝对路径到 ShardingSphere-Proxy 的 start.sh 启动脚本中,请注意配置自己对应的绝对路径。
+
```shell
nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
-javaagent:/xxxxx/agent/shardingsphere-agent-${latest.release.version}.jar \
@@ -109,6 +116,7 @@ nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
```
* 启动 ShardingSphere-Proxy
+
```shell
bin/start.sh
```
@@ -140,31 +148,32 @@ services:
```
## Metrics
-| 指标名称 | 类型 | 描述 |
-|:----------------------------------|:-----------|:-------------------------------------------------------|
-| proxy_request_total | COUNTER | 请求总数 |
-| proxy_connection_total | GAUGE | 当前连接总数 |
-| proxy_execute_latency_millis | HISTOGRAM | 执行耗时毫秒 |
-| proxy_execute_error_total | COUNTER | 执行异常总数 |
-| route_sql_select_total | COUNTER | 路由执行 select SQL 语句总数 |
-| route_sql_insert_total | COUNTER | 路由执行 insert SQL 语句总数 |
-| route_sql_update_total | COUNTER | 路由执行 update SQL 语句总数 |
-| route_sql_delete_total | COUNTER | 路由执行 delete SQL 语句总数 |
-| route_datasource_total | COUNTER | 数据源路由总数 |
-| route_table_total | COUNTER | 表路由数 |
-| proxy_transaction_commit_total | COUNTER | 事务提交次数 |
-| proxy_transaction_rollback_total | COUNTER | 事务回滚次数 |
-| parse_sql_dml_insert_total | COUNTER | 解析 insert SQL 语句总数 |
-| parse_sql_dml_delete_total | COUNTER | 解析 delete SQL 语句总数 |
-| parse_sql_dml_update_total | COUNTER | 解析 update SQL 语句总数 |
-| parse_sql_dml_select_total | COUNTER | 解析 select SQL 语句总数 |
-| parse_sql_ddl_total | COUNTER | 解析 DDL SQL 语句总数 |
-| parse_sql_dcl_total | COUNTER | 解析 DCL SQL 语句总数 |
-| parse_sql_dal_total | COUNTER | 解析 DAL SQL 语句总数 |
-| parse_sql_tcl_total | COUNTER | 解析 TCL SQL 语句总数 |
-| parse_dist_sql_rql_total | COUNTER | 解析 RQL 类型 DistSQL 总数 |
-| parse_dist_sql_rdl_total | COUNTER | 解析 RDL 类型 DistSQL 总数 |
-| parse_dist_sql_ral_total | COUNTER | 解析 RAL 类型 DistSQL 总数 |
-| build_info | GAUGE | 构建信息 |
-| proxy_info | GAUGE | proxy 信息, state:1 正常状态, state:2 熔断状态 |
-| meta_data_info | GAUGE | proxy 元数据信息, schema_count:逻辑库数量, database_count:数据源数量 |
+
+| 指标名称 | 类型 | 描述 |
+|:-------------------------------- |:--------- |:-------------------------------------------------------------- |
+| proxy_request_total | COUNTER | 请求总数 |
+| proxy_connection_total | GAUGE | 当前连接总数 |
+| proxy_execute_latency_millis | HISTOGRAM | 执行耗时毫秒 |
+| proxy_execute_error_total | COUNTER | 执行异常总数 |
+| route_sql_select_total | COUNTER | 路由执行 select SQL 语句总数 |
+| route_sql_insert_total | COUNTER | 路由执行 insert SQL 语句总数 |
+| route_sql_update_total | COUNTER | 路由执行 update SQL 语句总数 |
+| route_sql_delete_total | COUNTER | 路由执行 delete SQL 语句总数 |
+| route_datasource_total | COUNTER | 数据源路由总数 |
+| route_table_total | COUNTER | 表路由数 |
+| proxy_transaction_commit_total | COUNTER | 事务提交次数 |
+| proxy_transaction_rollback_total | COUNTER | 事务回滚次数 |
+| parse_sql_dml_insert_total | COUNTER | 解析 insert SQL 语句总数 |
+| parse_sql_dml_delete_total | COUNTER | 解析 delete SQL 语句总数 |
+| parse_sql_dml_update_total | COUNTER | 解析 update SQL 语句总数 |
+| parse_sql_dml_select_total | COUNTER | 解析 select SQL 语句总数 |
+| parse_sql_ddl_total | COUNTER | 解析 DDL SQL 语句总数 |
+| parse_sql_dcl_total | COUNTER | 解析 DCL SQL 语句总数 |
+| parse_sql_dal_total | COUNTER | 解析 DAL SQL 语句总数 |
+| parse_sql_tcl_total | COUNTER | 解析 TCL SQL 语句总数 |
+| parse_dist_sql_rql_total | COUNTER | 解析 RQL 类型 DistSQL 总数 |
+| parse_dist_sql_rdl_total | COUNTER | 解析 RDL 类型 DistSQL 总数 |
+| parse_dist_sql_ral_total | COUNTER | 解析 RAL 类型 DistSQL 总数 |
+| build_info | GAUGE | 构建信息 |
+| proxy_info | GAUGE | proxy 信息, state:1 正常状态, state:2 熔断状态 |
+| meta_data_info | GAUGE | proxy 元数据信息, schema_count:逻辑库数量, database_count:数据源数量 |
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
index e887e75b295..27baacd3c99 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
@@ -4,18 +4,23 @@ weight = 5
+++
## Compile source code
+
Download Apache ShardingSphere from GitHub,Then compile.
+
```shell
git clone --depth 1 https://github.com/apache/shardingsphere.git
cd shardingsphere
mvn clean install -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests -Prelease
```
+
Output directory: shardingsphere-agent/shardingsphere-agent-distribution/target/apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz
## Agent configuration
+
* Directory structure
Create agent directory, and unzip agent distribution package to the directory.
+
```shell
mkdir agent
tar -zxvf apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz -C agent
@@ -29,7 +34,7 @@ tree
│ ├── agent.yaml
│ └── logback.xml
├── plugins
- │ ├── shardingsphere-agent-logging-base-${latest.release.version}.jar
+ │ ├── shardingsphere-agent-logging-file-${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
@@ -37,16 +42,17 @@ tree
│ └── shardingsphere-agent-tracing-zipkin-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
+
* Configuration file
`META-INF/conf/agent.yaml` is used to manage agent configuration.
-Built-in plugins include Jaeger, OpenTracing, Zipkin, OpenTelemetry, BaseLogging and Prometheus.
+Built-in plugins include Jaeger, OpenTracing, Zipkin, OpenTelemetry, Log and Prometheus.
No plugin is enabled by default.
```yaml
plugins:
# logging:
-# BaseLogging:
+# File:
# props:
# level: "INFO"
# metrics:
@@ -79,6 +85,7 @@ plugins:
# otel-resource-attributes: "service.name=shardingsphere"
# otel-traces-exporter: "zipkin"
```
+
* Parameter description:
| Name | Description | Value range | Default value |
@@ -102,6 +109,7 @@ plugins:
* Edit the startup script
Configure the absolute path of shardingsphere-agent-${latest.release.version}.jar to the start.sh startup script of shardingsphere proxy.
+
```shell
nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
-javaagent:/xxxxx/agent/shardingsphere-agent-${latest.release.version}.jar \
@@ -109,9 +117,11 @@ nohup java ${JAVA_OPTS} ${JAVA_MEM_OPTS} \
```
* Start ShardingSphere-Proxy
+
```shell
bin/start.sh
```
+
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.
### Use via container environment
@@ -141,31 +151,32 @@ services:
```
## Metrics
-| name | type | description |
-|:---------------------------------|:-----------|:---------------------------------------------------------------------------------------------------------|
-| proxy_request_total | COUNTER | proxy request total |
-| proxy_connection_total | GAUGE | proxy connection total |
-| proxy_execute_latency_millis | HISTOGRAM | proxy executor latency millis |
-| proxy_execute_error_total | COUNTER | proxy executor error total |
-| route_sql_select_total | COUNTER | proxy executor route select sql total |
-| route_sql_insert_total | COUNTER | proxy executor route insert sql total |
-| route_sql_update_total | COUNTER | proxy executor route update sql total |
-| route_sql_delete_total | COUNTER | proxy executor route delete sql total |
-| route_datasource_total | COUNTER | number of datasource routed |
-| route_table_total | COUNTER | number of table routed |
-| proxy_transaction_commit_total | COUNTER | transaction commit count total |
-| proxy_transaction_rollback_total | COUNTER | transaction rollback count total |
-| parse_sql_dml_insert_total | COUNTER | proxy executor parse insert sql total |
-| parse_sql_dml_delete_total | COUNTER | proxy executor parse delete sql total |
-| parse_sql_dml_update_total | COUNTER | proxy executor parse update sql total |
-| parse_sql_dml_select_total | COUNTER | proxy executor parse select sql total |
-| parse_sql_ddl_total | COUNTER | proxy executor parse ddl sql total |
-| parse_sql_dcl_total | COUNTER | proxy executor parse dcl sql total |
-| parse_sql_dal_total | COUNTER | proxy executor parse dal sql total |
-| parse_sql_tcl_total | COUNTER | proxy executor parse tcl sql total |
-| parse_dist_sql_rql_total | COUNTER | proxy executor parse rql sql total |
-| parse_dist_sql_rdl_total | COUNTER | proxy executor parse rdl sql total |
-| parse_dist_sql_ral_total | COUNTER | proxy executor parse ral sql total |
-| build_info | GAUGE | build information |
-| proxy_info | GAUGE | proxy information, state:1 OK, state:2 CIRCUIT BREAK |
-| meta_data_info | GAUGE | meta data information, schema_count:logic number of databases, database_count:actual number of databases |
\ No newline at end of file
+
+| name | type | description |
+|:-------------------------------- |:--------- |:--------------------------------------------------------------------------------------------------------- |
+| proxy_request_total | COUNTER | proxy request total |
+| proxy_connection_total | GAUGE | proxy connection total |
+| proxy_execute_latency_millis | HISTOGRAM | proxy executor latency millis |
+| proxy_execute_error_total | COUNTER | proxy executor error total |
+| route_sql_select_total | COUNTER | proxy executor route select sql total |
+| route_sql_insert_total | COUNTER | proxy executor route insert sql total |
+| route_sql_update_total | COUNTER | proxy executor route update sql total |
+| route_sql_delete_total | COUNTER | proxy executor route delete sql total |
+| route_datasource_total | COUNTER | number of datasource routed |
+| route_table_total | COUNTER | number of table routed |
+| proxy_transaction_commit_total | COUNTER | transaction commit count total |
+| proxy_transaction_rollback_total | COUNTER | transaction rollback count total |
+| parse_sql_dml_insert_total | COUNTER | proxy executor parse insert sql total |
+| parse_sql_dml_delete_total | COUNTER | proxy executor parse delete sql total |
+| parse_sql_dml_update_total | COUNTER | proxy executor parse update sql total |
+| parse_sql_dml_select_total | COUNTER | proxy executor parse select sql total |
+| parse_sql_ddl_total | COUNTER | proxy executor parse ddl sql total |
+| parse_sql_dcl_total | COUNTER | proxy executor parse dcl sql total |
+| parse_sql_dal_total | COUNTER | proxy executor parse dal sql total |
+| parse_sql_tcl_total | COUNTER | proxy executor parse tcl sql total |
+| parse_dist_sql_rql_total | COUNTER | proxy executor parse rql sql total |
+| parse_dist_sql_rdl_total | COUNTER | proxy executor parse rdl sql total |
+| parse_dist_sql_ral_total | COUNTER | proxy executor parse ral sql total |
+| build_info | GAUGE | build information |
+| proxy_info | GAUGE | proxy information, state:1 OK, state:2 CIRCUIT BREAK |
+| meta_data_info | GAUGE | meta data information, schema_count:logic number of databases, database_count:actual number of databases |
diff --git a/test/e2e/agent/plugins/metrics/src/test/resources/docker/agent/conf/agent.yaml b/test/e2e/agent/plugins/metrics/src/test/resources/docker/agent/conf/agent.yaml
index 0fe50abd671..db0a729ea0c 100644
--- a/test/e2e/agent/plugins/metrics/src/test/resources/docker/agent/conf/agent.yaml
+++ b/test/e2e/agent/plugins/metrics/src/test/resources/docker/agent/conf/agent.yaml
@@ -17,7 +17,7 @@
plugins:
logging:
- BaseLogging:
+ File:
props:
level: "INFO"
metrics:
diff --git a/test/e2e/agent/plugins/opentelemetry/src/test/resources/docker/agent/conf/agent.yaml b/test/e2e/agent/plugins/opentelemetry/src/test/resources/docker/agent/conf/agent.yaml
index 35efa5725f7..ee884fb5c80 100644
--- a/test/e2e/agent/plugins/opentelemetry/src/test/resources/docker/agent/conf/agent.yaml
+++ b/test/e2e/agent/plugins/opentelemetry/src/test/resources/docker/agent/conf/agent.yaml
@@ -17,7 +17,7 @@
plugins:
logging:
- BaseLogging:
+ File:
props:
level: "INFO"
metrics:
diff --git a/test/e2e/agent/plugins/zipkin/src/test/resources/docker/agent/conf/agent.yaml b/test/e2e/agent/plugins/zipkin/src/test/resources/docker/agent/conf/agent.yaml
index 25e4c156264..c3cde96264d 100644
--- a/test/e2e/agent/plugins/zipkin/src/test/resources/docker/agent/conf/agent.yaml
+++ b/test/e2e/agent/plugins/zipkin/src/test/resources/docker/agent/conf/agent.yaml
@@ -17,7 +17,7 @@
plugins:
logging:
- BaseLogging:
+ File:
props:
level: "INFO"
metrics: