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 97582a9ff21 Revise agent/README.md (#23309)
97582a9ff21 is described below
commit 97582a9ff21c50a2091e0cf1dae27485c838f22c
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Jan 3 23:22:02 2023 +0800
Revise agent/README.md (#23309)
---
agent/README.md | 53 ++++++++++++++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/agent/README.md b/agent/README.md
index 76361ac4004..dbdd1b048c2 100644
--- a/agent/README.md
+++ b/agent/README.md
@@ -1,43 +1,51 @@
+# ShardingSphere Agent
+
+ShardingSphere-Agent module provides an observable framework for
ShardingSphere, which is implemented based on Java Agent.
## Features
-ShardingSphere-Agent module provides an observable framework for
ShardingSphere, which is implemented based on Java Agent.
+### Logging
-### Usage of logging
-The logging plugin is used to record logs of ShardingSphere.
+The logging plugin uses to record logs of ShardingSphere.
+Supports for File.
-### Usage of metrics
-The metrics plugin is used to collect and expose monitoring metrics, and
supports Prometheus by default.
+### Metrics
-### Usage of tracing
-The tracing plugin is used to obtain the link trace information of SQL parsing
and SQL execution. Supports for Jaeger, OpenTelemetry, OpenTracing and Zipkin.
+The metrics plugin uses to collect and expose monitoring metrics.
+Supports for prometheus.
+
+### Tracing
+
+The tracing plugin uses to obtain the link trace information of SQL parsing
and SQL execution.
+Supports for Jaeger, OpenTelemetry, OpenTracing and Zipkin.
## How To Build
+
```shell
git clone https://github.com/apache/shardingsphere.git
-
cd shardingsphere
-
-./mvnw clean install -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true
-Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests -Prelease
-```
-Artifact:
-```shell
-agent/distribution/target/apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz
# Binary package of ShardingSphere-Agent
+./mvnw clean install -Prelease
```
+Artifact is
`agent/distribution/target/apache-shardingsphere-${latest.release.version}-shardingsphere-agent-bin.tar.gz`
+
## Quick Start
+
* `shardingsphere-agent-{latest.release.version}.jar` is the agent startup jar.
* `conf/agent.yaml` is used to configure and enable plugins.
### Quick Start with Proxy
-Add the javaagent configuration in the Proxy startup script, as follows.
+
+Add the javaagent configuration in the Proxy startup script, as follows:
```shell
nohup $JAVA ${JAVA_OPTS} ${JAVA_MEM_OPTS}
-javaagent:/xx/xx/shardingsphere-agent-{latest.release.version}.jar -classpath
${CLASS_PATH} ${MAIN_CLASS} >> ${STDOUT_FILE} 2>&1 &
```
### Quick Start with JDBC
-When using ShardingSphere-JDBC, you need to add javaagent configuration in the
startup command, as follows.
+
+When using ShardingSphere-JDBC, you need to add javaagent configuration in the
startup command, as follows:
+
```shell
java -javaagent:/xx/xx/shardingsphere-agent-{latest.release.version}.jar -jar
project-using-shardingsphere-jdbc.jar
```
@@ -45,14 +53,18 @@ java
-javaagent:/xx/xx/shardingsphere-agent-{latest.release.version}.jar -jar pr
## Install Customized Plugins
### Usage of lib and plugins folders
+
* `lib` contains dependencies common to plugins.
* `plugins` contains all plugins.
### Extend via SPI PluginBootService
-`PluginBootService` is the plugin service definition interface, used to start
the plugin service. Custom plugins need to implement this interface.
+
+`PluginBootService` is the plugin service definition interface, used to start
the plugin service.
+Custom plugins need to implement this interface.
### Configure advisors.yaml
-`advisors.yaml` is used to define interception points. The format is as
follows.
+
+`advisors.yaml` is used to define interception points. The format is as
follows:
```yaml
advisors:
@@ -65,11 +77,14 @@ advisors:
- index: 3 # parameter index
type: java.util.Map # parameter type
```
-The file location is as follows.
+
+The file location is as follows:
+
* Proxy: META-INF/conf/{plugin-type}-proxy-advisors.yaml
* JDBC: META-INF/conf/{plugin-type}-jdbc-advisors.yaml
### Configure more metrics collector into metrics.yaml
+
`metrics.yaml` is the metrics definition file. The format is as follows.
```yaml