Merge branch 'master' of https://github.com/wu-sheng/sky-walking
This commit is contained in:
commit
1c3e385189
71
README.md
71
README.md
|
|
@ -24,12 +24,11 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对
|
|||
|plugins|using config file|using dynamic byte code| coding |remarks|
|
||||
| ----------- |---------| ----------|----------|----------|
|
||||
|web-plugin|web.xml| - | - | - |
|
||||
|dubbo-plugin| dubbo/dubbox config file | - | - | - |
|
||||
|spring-plugin| spring config file | - | - | - |
|
||||
|jdbc-plugin| jdbc config file | - | - | - |
|
||||
|mysql-plugin| - | YES | - | - |
|
||||
|tomcat8-plugin| - | YES | - | - |
|
||||
|dubbo-plugin| - | YES | - | - |
|
||||
|jdbc-plugin| - | YES | - | support mysql, oracle, sybase, sqlserver, jtds, db2, informix |
|
||||
|httpClient-4.x-plugin| - | YES | - | - |
|
||||
|httpClient-4.x-plugin-dubbox-rest-attachment| - | YES | - | required client-4.x-plugin |
|
||||
|jedis-2.x-plugin| - | YES | - | - |
|
||||
|
||||
|
||||
|
|
@ -82,7 +81,7 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对
|
|||

|
||||
|
||||
# Quick Start
|
||||
- master分支正在进行1.0-Final迭代。1.0b的完整代码,请参见 [1.0-beta-tag](https://github.com/wu-sheng/sky-walking/tree/1.0-beta)
|
||||
- master用于迭代开发,需要稳定版本请参见[Releases](releases)。1.0b的完整代码,请参见 [1.0-beta-tag](https://github.com/wu-sheng/sky-walking/tree/1.0-beta)
|
||||
- Developing of version 1.0-Final on branch Master. The source code of version [1.0-beta-tag](https://github.com/wu-sheng/sky-walking/tree/1.0-beta)
|
||||
|
||||
## 部署第三方软件 / Required of third party softwares
|
||||
|
|
@ -94,7 +93,7 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对
|
|||
- redis-3.0.5
|
||||
|
||||
## 插件支持的JDK / Supported jdk version
|
||||
- 1.6以上版本 / support 1.6+
|
||||
- 1.7以上版本 / support 1.7+
|
||||
|
||||
## 编译与部署 / Build and deploy
|
||||
- 服务端发布版本[下载](https://github.com/wu-sheng/sky-walking/releases) (.tar.gz)
|
||||
|
|
@ -105,67 +104,19 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对
|
|||
- [Code compilation instructions](BUILD_DOC.md)
|
||||
|
||||
|
||||
## 引入核心SDK / Import SDK
|
||||
[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-api/_latestVersion)
|
||||
## 下载官方的agent / Download offical agent
|
||||
[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-agent/_latestVersion)
|
||||
|
||||
- 核心SDK通过[skywalking bintray官网](https://bintray.com/wu-sheng/skywalking/)托管,可使用公网仓库[https://jcenter.bintray.com/](https://jcenter.bintray.com/)下载。
|
||||
- 官方agent通过[skywalking bintray官网](https://bintray.com/wu-sheng/skywalking/)托管,可使用公网仓库[https://jcenter.bintray.com/](https://jcenter.bintray.com/)下载。
|
||||
- use public repository [https://jcenter.bintray.com/](https://jcenter.bintray.com/) to download sdk
|
||||
- 无论试用哪种插件,都必须引入
|
||||
- add dependencies to pom.xml
|
||||
```xml
|
||||
<!-- API日志输出,客户端可指定所需的log4j2版本 -->
|
||||
<!-- 2.4.1为开发过程所选用版本 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
<!-- 监控api,可监控插件不支持的调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-api</artifactId>
|
||||
<version>{lastest-version}</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## 使用-javaagent 或 全新的main class
|
||||
- start application with -javaagent.
|
||||
|
||||
- Or using new main class, instead of the original main class.
|
||||
## 使用-javaagent 启动应用程序 / start application with -javaagent
|
||||
- 为应用程序添加启动参数
|
||||
```shell
|
||||
#原进程启动命令:
|
||||
#original starup command
|
||||
java com.company.product.Startup arg0 arg1
|
||||
|
||||
#全新的进程启动命令:
|
||||
#new starup command
|
||||
java com.ai.cloud.skywalking.plugin.TracingBootstrap com.company.product.Startup arg0 arg1
|
||||
java -jar ... -javaagent:/..ospath../skywalking-agent-x.x-Final.jar
|
||||
```
|
||||
|
||||
- 如果应用为Tomcat,需要修改tomcat相关启动文件:catalina.sh。推荐将项目转为tomcat-embeded模式。以下修改,仅作为参考。
|
||||
- If you want to trace a tomcat application, you need to modify 'catalina.sh'
|
||||
```
|
||||
# add skywalking jar into CLASSPATH
|
||||
CLASSPATH=$CLASSPATH:$CATALINA_HOME/lib/skywalking-api-{lastest-version}.jar:$CATALINA_HOME/lib/log4j-api.jar:$CATALINA_HOME/lib/log4j-core.jar
|
||||
|
||||
# use new main, samples in Tomcat8
|
||||
exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-sourcepath "$CATALINA_HOME"/../../java \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
com.ai.cloud.skywalking.plugin.TracingBootstrap org.apache.catalina.startup.Bootstrap "$@" start
|
||||
```
|
||||
|
||||
## 根据所需插件,配置应用程序 / Config application
|
||||
- Ref 《[SDK Guides](skywalking-sdk-plugin)》
|
||||
- 所有插件,已经通过[skywalking bintray官网](https://bintray.com/wu-sheng/skywalking/)托管,可使用公网仓库[https://jcenter.bintray.com/](https://jcenter.bintray.com/)下载。
|
||||
- 注意:插件不会引用所需的第三方组件(如Spring、dubbo、dubbox等),请自行引入所需的版本。
|
||||
|
||||
|
||||
## 下载并设置授权文件 / Download auth file
|
||||
- 注册并登陆过skywalking-webui,创建应用。(一个用户代表一个逻辑集群,一个应用代表一个服务集群。如前后端应用应该设置两个应用,但归属一个用户)
|
||||
- Sign up and login in skywalking-webui. Create application as needed.
|
||||
|
|
|
|||
|
|
@ -112,4 +112,12 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>bintray-wu-sheng-sky-walking-repository</id>
|
||||
<name>wu-sheng-sky-walking-repository</name>
|
||||
<url>https://api.bintray.com/maven/wu-sheng/skywalking/com.ai.cloud.skywalking-agent/;publish=1</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
|插件名称|功能|配置说明|版本与下载|
|
||||
| ----------- |---------| ----------|----------|
|
||||
|web-plugin|追踪指定的url访问| [查看](web-plugin) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-web-plugin/_latestVersion) |
|
||||
|dubbo-plugin| 追踪dubbo和dubbox的调用 | [查看](dubbo-plugin)|[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-dubbo-plugin/_latestVersion) |
|
||||
|spring-plugin| 追踪spring托管的类实例 | [查看](spring-plugin) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-spring-plugin/_latestVersion) |
|
||||
|jdbc-plugin| 追踪通过JDBC规范访问数据库 | [查看](jdbc-plugin) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-jdbc-plugin/_latestVersion) |
|
||||
|mysql-plugin| 追踪通过mysql官方5.1驱动访问数据库 | [查看](mysql-plugin)|[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-mysql-plugin/_latestVersion) |
|
||||
|httpClient-4.x-plugin| 追踪通过httpClient发起的http访问 | [查看](httpClient-4.x-plugin) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin/_latestVersion) |
|
||||
|httpClient-4.x-plugin-dubbox-rest-attachment| 追踪通过httpClient调用dubbox发布的rest服务 | [查看](httpClient-4.x-plugin-dubbox-rest-attachment) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin-dubbox-rest-attachment/_latestVersion) |
|
||||
|jedis-2.x-plugin| 追踪jedis 2.8发起的redis访问 | [查看](jedis-2.x-plugin) |[  ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-web-plugin/_latestVersion) |
|
||||
|~~httpclient-4.2.x-plugin~~| 追踪httpclient发起的访问 | [查看](httpclient-4.2.x-plugin) | No Provieded|
|
||||
|~~httpclient-4.3.x-plugin~~| 追踪httpclient发起的访问 | [查看](httpclient-4.3.x-plugin) | No Provieded|
|
||||
|
||||
- 绝大多数插件,已经集成到skywalking-agent中,无需单独引入即可生效。
|
||||
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
# 如何追踪dubbo调用?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<!-- dubbo插件,监控dubbo/dubbox调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
- 这里的dubbo,专指阿里发布的,已停止维护的标准dubbo版本([dubbo.io](http://dubbo.io/))。扩展版本dubbox请参考相关章节。
|
||||
- 在客户端和服务端配置全局filter:swEnhanceFilter。
|
||||
```xml
|
||||
//客户端Spring配置文件
|
||||
<dubbo:consumer filter="swEnhanceFilter"/>
|
||||
|
||||
//服务端Spring配置文件
|
||||
<dubbo:provider filter="swEnhanceFilter"/>
|
||||
```
|
||||
|
||||
# 如何追踪dubbox 2.8.4 调用?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<!-- dubbo插件,监控dubbo/dubbox调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
- dubbox 2.8.4 较为符合dubbo的服务规范,这里指dubbox支持RpcContext中的attachment。追踪方式和dubbo相同。
|
||||
- 在客户端和服务端配置全局filter:swEnhanceFilter。
|
||||
```xml
|
||||
//客户端Spring配置文件
|
||||
<dubbo:consumer filter="swEnhanceFilter"/>
|
||||
|
||||
//服务端Spring配置文件
|
||||
<dubbo:provider filter="swEnhanceFilter"/>
|
||||
```
|
||||
|
||||
# 如何追踪dubbox 2.8.3 以及之前版本的调用?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<!-- dubbo插件,监控dubbo/dubbox调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
- 由于引入dubbox,主要目的是使用rest+json协议,所以以下方案都是在此种调用模式下的解决方案。其他协议未测试,请谅解,望大家提供测试结果与反馈。
|
||||
- dubbox 2.8.3 以及之前版本不能正确的支持RpcContext中的attachment,存在BUG(2.8.4已修复)。采用扩展参数对象的方法支持追踪的传递性。
|
||||
- 注意:依然推荐升级到dubbox 2.8.4,此时能更好的进行追踪,并对程序侵入性更小。
|
||||
- 在客户端和服务端配置全局filter:swEnhanceFilter。
|
||||
```xml
|
||||
//客户端Spring配置文件
|
||||
<dubbo:consumer filter="swEnhanceFilter"/>
|
||||
|
||||
//服务端Spring配置文件
|
||||
<dubbo:provider filter="swEnhanceFilter"/>
|
||||
```
|
||||
- 在客户端和服务端启动时,开启dubbox 2.8.3之前版本的修复功能。在服务启动前调用如下代码,或将com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve注册到Spring中。
|
||||
```java
|
||||
new com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve();
|
||||
```
|
||||
- dubbox调用参数包含javabean参数,并继承com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.SWBaseBean。只包含java基础类型(如:String、Integer等)的调用,无法支持追踪传递
|
||||
- 客户端如果直接使用非dubbox客户端发起http restful调用,需要在发送的参数中设置contextData。
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# 如何追踪通过httpClient发起的http访问?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-httpClient-4.x-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
# 如何追踪MySQL访问?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<!-- jdbc插件,监控所有的jdbc调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
- 设置特定的JDBC Driver
|
||||
```properties
|
||||
Driver="com.ai.cloud.skywalking.plugin.jdbc.mysql.MySQLTracingDriver"
|
||||
```
|
||||
- 设置特定的JDBC URL
|
||||
```properties
|
||||
jdbc.url=tracing:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
|
||||
```
|
||||
|
||||
# 如何追踪MySQL之外的其他JDBC?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<!-- jdbc插件,监控所有的jdbc调用 -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
- 轻松实现自定义的JDBC Driver扩展
|
||||
```java
|
||||
import java.sql.Driver;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.jdbc.TracingDriver;
|
||||
|
||||
public class XXXDBTracingDriver extends TracingDriver {
|
||||
static {
|
||||
try {
|
||||
DriverManager.registerDriver(new XXXDBTracingDriver());
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("register "
|
||||
+ MySQLTracingDriver.class.getName() + " driver failure.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 继承自TracingDriver,返回真实的Driver
|
||||
*/
|
||||
@Override
|
||||
protected Driver registerTracingDriver() {
|
||||
try {
|
||||
//示例:return new com.mysql.jdbc.Driver();
|
||||
return new Driver();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("create Driver failure.");
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
- 设置新实现的JDBC Driver
|
||||
```properties
|
||||
Driver="XXXDBTracingDriver"
|
||||
```
|
||||
- 设置特定的JDBC URL
|
||||
```properties
|
||||
jdbc.url=tracing:jdbc:xxxdb://localhost:3306/test
|
||||
```
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# 如何追踪jedis 2.8发起的redis访问?
|
||||
- 引入所需插件
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jedis-2.x-plugin</artifactId>
|
||||
<version>{latest_version}</version>
|
||||
</dependency>
|
||||
```
|
||||
Loading…
Reference in New Issue