README.md 10.5 KB
Newer Older
wu-sheng's avatar
wu-sheng 已提交
1 2 3
Sky Walking
==========

wu-sheng's avatar
wu-sheng 已提交
4
<img src="http://wu-sheng.github.io/sky-walking/images/skywalking.png" alt="Sky Walking logo" height="90px" align="right" />
wu-sheng's avatar
wu-sheng 已提交
5

wu-sheng's avatar
wu-sheng 已提交
6
SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, 是一个对JAVA分布式应用程序集群的业务运行情况进行追踪、告警和分析的系统。
wu-sheng's avatar
wu-sheng 已提交
7

wu-sheng's avatar
wu-sheng 已提交
8
[![Build Status](https://travis-ci.org/wu-sheng/sky-walking.svg?branch=master)](https://travis-ci.org/wu-sheng/sky-walking)
9
![license](https://img.shields.io/aur/license/yaourt.svg)
wu-sheng's avatar
wu-sheng 已提交
10

wu-sheng's avatar
wu-sheng 已提交
11
# 简介 / abstract
wu-sheng's avatar
wu-sheng 已提交
12 13
* 核心理论为[Google Dapper论文:Dapper, a Large-Scale Distributed Systems Tracing Infrastructure](http://research.google.com/pubs/pub36356.html),英语有困难的同学可参考[国内翻译](http://duanple.blog.163.com/blog/static/70971767201329113141336/)
* 本分析系统能通过不修改或少量修改代码的模式,对现有的JAVA应用或J2EE应用进行监控和数据收集,并针对应用进场进行准实时告警。此外提供大量的调用性能分析功能,解决目前的监控系统主要监控进程、端口而非应用实际性能的问题。
wu-sheng's avatar
wu-sheng 已提交
14
* 支持国内常用的dubbo以及dubbox等常见RPC框架,支持应用异常的邮件告警
15 16
* skywalking-sdk层面提供的埋点API,同步阻塞访问时间小于100μs
* 通过[byte-buddy](https://github.com/raphw/byte-buddy),部分插件将通过动态字节码机制,避免代码侵入性,完成监控。动态代码模式埋点,同步阻塞访问时间应在200-300μs
wu-sheng's avatar
wu-sheng 已提交
17 18 19
* SkyWalking is an open source Large-Scale Distributed Systems Tracing Infrastructure, also been known as APM(Application Performance Management) tool. SkyWalking provides a solution to help monitor and analysis a Large-Scale Distributed Systems.
* SkyWalking supports popular rpc frameworks, such as [dubbo](https://github.com/alibaba/dubbo), [dubbox](https://github.com/dangdangdotcom/dubbox), etc., supports email-alert when application occurs unexpected exception。
* SkyWalking's basic API, execution time of blocking saving span must less than 100μs.
wu-sheng's avatar
wu-sheng 已提交
20
* By using [byte-buddy](https://github.com/raphw/byte-buddy) (Thanks to [raphw](https://github.com/raphw)), some plugins use dynamic byte code generation to avoid invasive codes. plugins API, execution time of blocking saving span must between 200μs and 300μs, including execution time of dynamic byte code.
wu-sheng's avatar
wu-sheng 已提交
21

22
|plugins|using config file|using dynamic byte code| coding |remarks|
wu-sheng's avatar
wu-sheng 已提交
23 24
| ----------- |---------| ----------|----------|----------|
|web-plugin|web.xml| - | - | - |
25 26 27
|dubbo-plugin| dubbo/dubbox config file | - | - | - |
|spring-plugin| spring config file | - | - | - |
|jdbc-plugin| jdbc config file | - | - | - |
wu-sheng's avatar
wu-sheng 已提交
28
|mysql-plugin| - | YES | - | - |
wu-sheng's avatar
wu-sheng 已提交
29
|httpClient-4.x-plugin| - | YES | - | - |
30
|httpClient-4.x-plugin-dubbox-rest-attachment| - | YES | - | required client-4.x-plugin |
wu-sheng's avatar
wu-sheng 已提交
31
|jedis-2.x-plugin| - | YES | - | - |
wu-sheng's avatar
wu-sheng 已提交
32 33 34 35
|~~httpclient-4.2.x-plugin~~| - | - | YES | 需要使用新提供的httpClient包装对象 |
|~~httpclient-4.3.x-plugin~~| - | - | YES | 需要使用新提供的httpClient包装对象 |

* 删除插件为最新版本不推荐使用的插件
wu-sheng's avatar
wu-sheng 已提交
36

wu-sheng's avatar
wu-sheng 已提交
37 38 39 40
* 所需应用程序包下载

|components| download lastest version|
| ----------- |---------|
wu-sheng's avatar
wu-sheng 已提交
41
|skywalking-base| [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
42 43
|skywalking-protocol|  [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-protocol/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-protocol/_latestVersion) |
|skywalking-api|[ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-api/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-api/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
44
|skywalking-sdk-plugin| [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-sdk-plugin/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-sdk-plugin/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
45
|skywalking-dubbo-plugin| [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-dubbo-plugin/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-dubbo-plugin/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
46
|skywalking-httpClient-4.x-plugin| [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
47
|com.ai.cloud.skywalking-httpClient-4.x-plugin-dubbox-rest-attachment| [ ![Download](https://api.bintray.com/packages/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin-dubbox-rest-attachment/images/download.svg) ](https://bintray.com/wu-sheng/skywalking/com.ai.cloud.skywalking-httpClient-4.x-plugin-dubbox-rest-attachment/_latestVersion) |
wu-sheng's avatar
wu-sheng 已提交
48 49


wu-sheng's avatar
wu-sheng 已提交
50
# 新版本能力规划
wu-sheng's avatar
wu-sheng 已提交
51
* 提供一定的日志数据分析和展现能力,减少或者避免使用团队的二次开发
wu-sheng's avatar
wu-sheng 已提交
52

wu-sheng's avatar
wu-sheng 已提交
53 54 55
# 主要贡献者 / Contributors
* 吴晟 [wusheng](https://github.com/wu-sheng) &nbsp;&nbsp;[亚信 Asiainfo](http://www.asiainfo.com/) wusheng@asiainfo.com
* 张鑫 [zhangxin](https://github.com/ascrutae) &nbsp;&nbsp;[亚信 Asiainfo](http://www.asiainfo.com/) zhangxin10@asiainfo.com
wu-sheng's avatar
wu-sheng 已提交
56

wu-sheng's avatar
wu-sheng 已提交
57
# 交流
wu-sheng's avatar
wu-sheng 已提交
58
* Mail to:wu.sheng@foxmail.com
wu-sheng's avatar
wu-sheng 已提交
59
* QQ群:392443393,请注明“Sky Walking交流”
wu-sheng's avatar
wu-sheng 已提交
60
* 谁在使用Sky Walking?[点击进入](https://github.com/wu-sheng/sky-walking/issues/34)。同时请各位使用者反馈下,都在哪些项目中使用。
wu-sheng's avatar
wu-sheng 已提交
61
* if you are using SkyWalking,[Report to us](https://github.com/wu-sheng/sky-walking/issues/34) please.
wu-sheng's avatar
wu-sheng 已提交
62

wu-sheng's avatar
wu-sheng 已提交
63 64 65
# 整体架构图
![整体架构图](http://wu-sheng.github.io/sky-walking/sample-code/images/skywalkingClusterDeploy.jpeg)

66
# 典型页面展现 / Typical UI show
67
* 支持浏览器:Firefox/Chrome
wu-sheng's avatar
wu-sheng 已提交
68

wu-sheng's avatar
wu-sheng 已提交
69 70
## 实时调用链路
* 实时链路追踪展现
wu-sheng's avatar
wu-sheng 已提交
71
![追踪连路图1](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/callChain.png)
wu-sheng's avatar
wu-sheng 已提交
72
* 实时链路追踪详细信息查看
wu-sheng's avatar
wu-sheng 已提交
73
![追踪连路图2](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/callChainDetail.png)
wu-sheng's avatar
wu-sheng 已提交
74
* 实时链路追踪日志查看
wu-sheng's avatar
wu-sheng 已提交
75
![追踪连路图3](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/callChainLog.png)
wu-sheng's avatar
wu-sheng 已提交
76
* 实时链路异常告警邮件
wu-sheng's avatar
wu-sheng 已提交
77
![告警邮件](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/alarmMail.png)
wu-sheng's avatar
wu-sheng 已提交
78 79 80 81
* 添加应用
![添加应用](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/addApp.png)
* 应用列表展现
![应用列表展现](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/appList.png)
wu-sheng's avatar
wu-sheng 已提交
82 83 84 85 86 87
* 分析结果查询
![应用列表展现](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/searchAnalysisResult.png)
* 分析结果展现
![应用列表展现](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/analysisResult.png)
* 分析典型调用链展现
![应用列表展现](http://wu-sheng.github.io/sky-walking/sample-code/screenshoot/1.0b/typicalAnalysisResult.png)
wu-sheng's avatar
wu-sheng 已提交
88

wu-sheng's avatar
wu-sheng 已提交
89
## 分析汇总
wu-sheng's avatar
wu-sheng 已提交
90

wu-sheng's avatar
wu-sheng 已提交
91
# Quick Start
wu-sheng's avatar
wu-sheng 已提交
92
## 编译与部署 / Build and deploy
wu-sheng's avatar
补充  
wu-sheng 已提交
93
- 参考《[代码编译部署说明](BUILD_DOC.md)
wu-sheng's avatar
wu-sheng 已提交
94
- [Code compilation and deployment instructions](BUILD_DOC.md)
wu-sheng's avatar
wu-sheng 已提交
95

96 97 98
## 引入核心SDK / Import SDK
- 无论试用哪种插件,都必须引入
- add dependencies to pom.xml
wu-sheng's avatar
wu-sheng 已提交
99
```xml
wu-sheng's avatar
wu-sheng 已提交
100
<!-- API日志输出,客户端可指定所需的log4j2版本 -->
wu-sheng's avatar
wu-sheng 已提交
101
<!-- 2.4.1为开发过程所选用版本 -->
wu-sheng's avatar
wu-sheng 已提交
102 103 104 105 106
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.4.1</version>
</dependency>
wu-sheng's avatar
wu-sheng 已提交
107 108 109 110
<!-- 监控api,可监控插件不支持的调用 -->
<dependency>
    <groupId>com.ai.cloud</groupId>
    <artifactId>skywalking-api</artifactId>
wu-sheng's avatar
wu-sheng 已提交
111
    <version>{lastest-version}</version>
wu-sheng's avatar
wu-sheng 已提交
112
</dependency>
wu-sheng's avatar
wu-sheng 已提交
113 114
```

wu-sheng's avatar
wu-sheng 已提交
115
## 使用全新的main class
116
- using new main class, instead of the original main class.
wu-sheng's avatar
wu-sheng 已提交
117 118
```shell
#原进程启动命令:
119
#original starup command
wu-sheng's avatar
wu-sheng 已提交
120 121 122
java com.company.product.Startup arg0 arg1

#全新的进程启动命令:
123
#new starup command
wu-sheng's avatar
wu-sheng 已提交
124 125 126
java com.ai.cloud.skywalking.plugin.TracingBootstrap com.company.product.Startup arg0 arg1
```

wu-sheng's avatar
wu-sheng 已提交
127 128
- 如果应用为Tomcat,需要修改tomcat相关启动文件:catalina.sh
- If you want to trace a tomcat application, you need to modify 'catalina.sh'
wu-sheng's avatar
wu-sheng 已提交
129 130
```
# add skywalking jar into CLASSPATH
wu-sheng's avatar
wu-sheng 已提交
131
CLASSPATH=$CLASSPATH:$CATALINA_HOME/lib/skywalking-api-{lastest-version}.jar:$CATALINA_HOME/lib/log4j-api.jar:$CATALINA_HOME/lib/log4j-core.jar
wu-sheng's avatar
wu-sheng 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144

# 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
```

145
## 根据所需插件,配置应用程序 / Config application
wu-sheng's avatar
wu-sheng 已提交
146
- Ref 《[SDK Guides](skywalking-sdk-plugin)
147
- 注意:插件不会引用所需的第三方组件(如Spring、dubbo、dubbox等),请自行引入所需的版本。
wu-sheng's avatar
wu-sheng 已提交
148

149

150
## 下载并设置授权文件 / Download auth file
wu-sheng's avatar
wu-sheng 已提交
151
- 注册并登陆过skywalking-webui,创建应用。(一个用户代表一个逻辑集群,一个应用代表一个服务集群。如前后端应用应该设置两个应用,但归属一个用户)
152 153 154
- Sign up and login in skywalking-webui. Create application as needed.
- 下载授权文件,并在运行时环境中,将授权文件加入到CLASSPATH或LIB中
- download auth file(*.jar), and add the jar file to the CLASSPATH or lib.
wu-sheng's avatar
wu-sheng 已提交
155

156
## 在运行时环境中设置环境变量 / set environment variables 
wu-sheng's avatar
wu-sheng 已提交
157
```
wu-sheng's avatar
wu-sheng 已提交
158
export SKYWALKING_RUN=true
wu-sheng's avatar
wu-sheng 已提交
159
```
wu-sheng's avatar
wu-sheng 已提交
160 161 162 163 164
- 设置完成后,SkyWalking将随应用启动运行
- After set env, SkyWalking will be working, when application startup.

# 在应用程序中显示traceid / How to find tid
- [Find TID](HOW_TO_FIND_TID.md)
wu-sheng's avatar
wu-sheng 已提交
165

wu-sheng's avatar
wu-sheng 已提交
166 167
# QA
- [SkyWalking SDK是否已经工作? Is SkyWalking SDK Running?](QA/IS_RUNNING.md)
wu-sheng's avatar
wu-sheng 已提交
168
- [tid在web-ui上无法查询. tid can't be search on web-ui](QA/TID_CANNOT_BE_SEARCH.md)
169
- [SkyWalking Server的运行情况. The status of SkyWalking Server](QA/SERVER_RUNNING_STAUTS.md)
wu-sheng's avatar
wu-sheng 已提交
170
- [SkyWalking Analysis部署运行常见问题. The FAQ of SkyWalking Analysis deployment](QA/deploy-sw_analysis-problem.md)
wu-sheng's avatar
wu-sheng 已提交
171

wu-sheng's avatar
wu-sheng 已提交
172
# 源代码说明
wu-sheng's avatar
wu-sheng 已提交
173
* [追踪日志明细存储结构说明. the storage structure of tracking logs](skywalking-server/doc/hbase_table_desc.md)