diff --git a/README.md b/README.md index 774dcaecd..9ddf35c33 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known D [![codebeat badge](https://codebeat.co/badges/579e4dce-1dc7-4f32-a163-c164eafa1335)](https://codebeat.co/projects/github-com-wu-sheng-sky-walking) [![Join the chat at https://gitter.im/sky-walking/Lobby](https://badges.gitter.im/sky-walking/Lobby.svg)](https://gitter.im/sky-walking/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Release Version](https://img.shields.io/badge/sky--walking-1.0--release-brightgreen.svg)](https://github.com/wu-sheng/sky-walking/releases) +[![Dev Version](https://img.shields.io/badge/sky--walking-2.0--indev-yellow.svg)](https://github.com/wu-sheng/sky-walking) + # Abstract * An open source Large-Scale Distributed Systems Tracing Infrastructure, also known a ditributed tracer. * Based on [Google Dapper Paper: Dapper, a Large-Scale Distributed Systems Tracing Infrastructure](http://research.google.com/pubs/pub36356.html), [read Simplified Chinese Version](http://duanple.blog.163.com/blog/static/70971767201329113141336/) @@ -20,8 +23,10 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known D # Supported components * web container - * Tomcat7 - * Tomcat8 + + [![Tomcat 7 Test Docker](https://img.shields.io/badge/test--scenario-tomcat--7.0.73-brightgreen.svg)](https://hub.docker.com/r/skywalking/docker-tomcat-scenario/tags/) +[![Tomcat 8 Test Docker](https://img.shields.io/badge/test--scenario-tomcat--8.0.39-brightgreen.svg)](https://hub.docker.com/r/skywalking/docker-tomcat-scenario/tags/) + * database * mysql * oracle @@ -35,6 +40,7 @@ SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known D * cache * jedix 2.x +_All test scenarios base on Docker Tech._ # Contributors * 吴晟 [wusheng](https://github.com/wu-sheng)   wu.sheng@foxmail.com diff --git a/pom.xml b/pom.xml index 57d6da095..6aaf68a71 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ skywalking-commons skywalking-alarm - + skywalking-webui skywalking-sniffer skywalking-storage-center skywalking-opentracing-kit diff --git a/skywalking-webui/pom.xml b/skywalking-webui/pom.xml index 5eb12cced..331389abb 100644 --- a/skywalking-webui/pom.xml +++ b/skywalking-webui/pom.xml @@ -1,39 +1,40 @@ 4.0.0 - com.a.eye + + + skywalking + com.a.eye + 2.0-2016 + + skywalking-webui - 2.0-2016 - http://maven.apache.org war - UTF-8 4.1.6.RELEASE skywalking - - - maven-compiler-plugin - - 1.7 - 1.7 - ${project.build.sourceEncoding} - - - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - + + com.a.eye + skywalking-network + ${project.version} + + + com.a.eye + skywalking-logging-api + ${project.parent.version} + + + com.a.eye + skywalking-logging-impl-log4j2 + ${project.parent.version} + + org.springframework spring-webmvc @@ -86,16 +87,6 @@ mysql-connector-java 5.1.36 - - org.apache.commons - commons-dbcp2 - 2.0 - - - org.apache.hbase - hbase-client - 1.1.2 - org.aspectj aspectjweaver @@ -106,12 +97,6 @@ gson 2.2.2 - - com.google.protobuf - protobuf-java - 2.5.0 - - com.zaxxer HikariCP diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/AuthFileController.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/AuthFileController.java deleted file mode 100644 index 40c4310a5..000000000 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/controller/AuthFileController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.a.eye.skywalking.web.controller; - -import com.a.eye.skywalking.web.dto.LoginUserInfo; -import com.a.eye.skywalking.web.common.BaseController; -import com.a.eye.skywalking.web.dao.inter.IAuthFileMaintainDao; -import com.a.eye.skywalking.web.dao.inter.ISystemConfigMaintainDao; -import com.a.eye.skywalking.web.util.StringUtil; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.util.Map; -import java.util.Properties; - -/** - * Created by xin on 16-3-29. - */ -@RequestMapping("/usr/applications/authfile") -@Controller -public class AuthFileController extends BaseController { - - private Logger logger = LogManager.getLogger(AuthFileController.class); - - @Autowired - private ISystemConfigMaintainDao systemConfigMaintainDao; - - @Autowired - private IAuthFileMaintainDao authFileMaintainDao; - - @RequestMapping("/todownload/{applicationCode}") - public String toDownloadFile(@PathVariable("applicationCode") String applicationCode, HttpServletRequest request) { - request.setAttribute("applicationId", applicationCode); - return "usr/authfile/download"; - } - - @RequestMapping("/download/{applicationCode}") - public void exportApplicationAuthFile(HttpServletRequest request, HttpServletResponse response, - @PathVariable("applicationCode") String applicationCode, String authType) throws Exception { - if (StringUtil.isBlank(applicationCode)) { - return; - } - LoginUserInfo loginUserInfo = fetchLoginUserInfoFromSession(request); - String filepath = "sky-walking.auth"; - response.reset(); - response.setContentType("application/octet-stream"); - String fileName = URLDecoder.decode(filepath, "utf-8"); - java.net.URLEncoder.encode(fileName, "utf-8"); - response.addHeader("Content-Disposition", - "attachment;" + "filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\""); - - Properties properties = authFileMaintainDao.queryAuthKeysToProperties(authType); - String propertyValue; - for (Map.Entry value : properties.entrySet()) { - propertyValue = String.valueOf(value.getValue()); - if (propertyValue.startsWith("#")) { - logger.info("{}", propertyValue.substring(1)); - value.setValue(systemConfigMaintainDao.querySystemConfigByKey(propertyValue.substring(1)).getConfValue()); - continue; - } - - if (propertyValue.startsWith("$")) { - if (request.getParameter((propertyValue.substring(1))) != null) { - value.setValue(request.getParameter(propertyValue.substring(1))); - } - } - } - properties.setProperty("skywalking.user_id", loginUserInfo.getUid()); - properties.setProperty("skywalking.application_code", applicationCode); - - File file = new File(request.getServletContext().getRealPath("/") + File.separator + "download" + File.separator + fileName); - file.delete(); - FileOutputStream stream = new FileOutputStream(file); - properties.store(stream, ""); - stream.flush(); - stream.close(); - FileInputStream inputStream = new FileInputStream(file); - - BufferedOutputStream output = null; - BufferedInputStream input = null; - OutputStream os = null; - try { - os = response.getOutputStream(); - byte[] bytes = new byte[1024]; - while ((inputStream.read(bytes)) != -1) { - os.write(bytes); - } - } catch (Exception e) { - logger.error("Failed to download the auth file.", e); - } finally { - os.flush(); - os.close(); - inputStream.close(); - if (input != null) { - input.close(); - } - if (output != null) { - output.close(); - } - } - return; - } -} diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/impl/AuthFileMaintainDao.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/impl/AuthFileMaintainDao.java deleted file mode 100644 index 99ae9cc33..000000000 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/impl/AuthFileMaintainDao.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.a.eye.skywalking.web.dao.impl; - -import com.a.eye.skywalking.web.dao.inter.IAuthFileMaintainDao; -import com.a.eye.skywalking.web.util.DBConnectUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; - -@Repository -public class AuthFileMaintainDao implements IAuthFileMaintainDao { - - @Autowired - private DBConnectUtil dbConnectUtil; - - @Override - public Properties queryAuthKeysToProperties(String authType) throws SQLException { - final Properties properties = new Properties(); - String sql = "select auth_file_config.key, auth_file_config.value" + authType + " from auth_file_config where auth_file_config.sts = ? "; - Connection connection = dbConnectUtil.getConnection(); - try { - PreparedStatement preparedStatement = connection.prepareStatement(sql); - preparedStatement.setString(1, "A"); - ResultSet resultSet = preparedStatement.executeQuery(); - while (resultSet.next()) { - properties.setProperty(resultSet.getString("key"), resultSet.getString("value" + authType)); - } - } catch (Exception e) { - throw new RuntimeException("Failed to query auth key by authType[" + authType + "]", e); - } finally { - if (connection != null) - connection.close(); - } - return properties; - } -} diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/inter/IAuthFileMaintainDao.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/inter/IAuthFileMaintainDao.java deleted file mode 100644 index d54876608..000000000 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/dao/inter/IAuthFileMaintainDao.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.a.eye.skywalking.web.dao.inter; - -import java.sql.SQLException; -import java.util.Properties; - -/** - * Created by xin on 16-3-29. - */ -public interface IAuthFileMaintainDao { - Properties queryAuthKeysToProperties(String authType) throws SQLException; -} diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/entity/SystemConfig.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/entity/SystemConfig.java deleted file mode 100644 index 2c0e797d4..000000000 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/entity/SystemConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.a.eye.skywalking.web.entity; - -/** - * Created by xin on 16-3-29. - */ -public class SystemConfig { - private String configId; - private String confKey; - private String confValue; - private String valueType; - private String valueDesc; - - public void setConfigId(String configId) { - this.configId = configId; - } - - public String getConfigId() { - return configId; - } - - public void setConfKey(String confKey) { - this.confKey = confKey; - } - - public String getConfKey() { - return confKey; - } - - public void setConfValue(String confValue) { - this.confValue = confValue; - } - - public String getConfValue() { - return confValue; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public String getValueType() { - return valueType; - } - - public void setValueDesc(String valueDesc) { - this.valueDesc = valueDesc; - } - - public String getValueDesc() { - return valueDesc; - } -} diff --git a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/util/HBaseUtils.java b/skywalking-webui/src/main/java/com/a/eye/skywalking/web/util/HBaseUtils.java deleted file mode 100644 index 2e317925e..000000000 --- a/skywalking-webui/src/main/java/com/a/eye/skywalking/web/util/HBaseUtils.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.a.eye.skywalking.web.util; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.client.Connection; -import org.apache.hadoop.hbase.client.ConnectionFactory; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Repository; - -/** - * Created by xin on 16-3-21. - */ -@Repository -public class HBaseUtils { - @Value("#{configProperties['hbaseconfig.quorum']}") - private String quorum; - @Value("#{configProperties['hbaseconfig.client_port']}") - private String clientPort; - - private static Logger logger = LogManager.getLogger(HBaseUtils.class); - - private Connection connection = null; - - public Connection getConnection() { - if (connection == null) { - try { - Configuration configuration = HBaseConfiguration.create(); - configuration.set("hbase.zookeeper.quorum", quorum); - configuration.set("hbase.zookeeper.property.clientPort", clientPort); - connection = ConnectionFactory.createConnection(configuration); - } catch (Exception e) { - logger.error("Create table[{}] failed", "connection hbase fail", e); - throw new RuntimeException("Fatal error"); - } - } - - return connection; - } -} diff --git a/skywalking-webui/src/main/resources/config.properties b/skywalking-webui/src/main/resources/config.properties deleted file mode 100644 index 2b34e7644..000000000 --- a/skywalking-webui/src/main/resources/config.properties +++ /dev/null @@ -1,2 +0,0 @@ -hbaseconfig.quorum=10.1.241.18,10.1.241.19,10.1.241.20 -hbaseconfig.client_port=29181 diff --git a/skywalking-webui/src/main/resources/jdbc.properties b/skywalking-webui/src/main/resources/jdbc.properties index b5c5fa600..de394648b 100644 --- a/skywalking-webui/src/main/resources/jdbc.properties +++ b/skywalking-webui/src/main/resources/jdbc.properties @@ -1,7 +1,7 @@ jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://10.1.241.20:31306/sw_db -jdbc.username=sw_dbusr01 -jdbc.password=sw_dbusr01 +jdbc.username=sw_dbusr +jdbc.password=sw_dbusr jdbc.maxTotal=200 jdbc.maxIdle=50 jdbc.maxWaitMillis=1000 diff --git a/skywalking-webui/src/main/sql/table.mysql b/skywalking-webui/src/main/sql/table.mysql index d6a54a75c..7025d5cf8 100644 --- a/skywalking-webui/src/main/sql/table.mysql +++ b/skywalking-webui/src/main/sql/table.mysql @@ -196,76 +196,9 @@ SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -CREATE TABLE `auth_file_config` ( - `config_id` INT(11) NOT NULL, - `key` VARCHAR(200) NOT NULL, - `value0` VARCHAR(200) NULL, - `value1` VARCHAR(200) NULL DEFAULT NULL, - `value2` VARCHAR(200) NULL DEFAULT NULL, - `value3` VARCHAR(200) NULL DEFAULT NULL, - `value4` VARCHAR(200) NULL DEFAULT NULL, - `key_desc` VARCHAR(500) NULL, - `sts` VARCHAR(2) NULL, - PRIMARY KEY (`config_id`)); - - - CREATE TABLE `sw_chain_info` ( - `id` INT NOT NULL AUTO_INCREMENT, - `viewpoint` VARCHAR(1024) NULL, - `cid` VARCHAR(32) NULL, - `uid` VARCHAR(32) NULL, - `parentLevelId` VARCHAR(32) NULL, - `levelId` INT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `id_UNIQUE` (`id` ASC)); - -# 请参考文档和环境进行修改 -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1000,'mail_info','{\"mail.host\":\"mail.asiainfo.com\",\"mail.transport.protocol\":\"smtp\",\"mail.smtp.auth\":\"true\",\"mail.smtp.starttls.enable\":\"false\",\"mail.username\":\"testA\",\"mail.password\":\"******\",\"mail.sender\":\"mailSender@asiainfo.com\"}','json','默认邮件发送人信息','2015-12-10 11:54:06','A','2015-12-10 11:54:06'); -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1001,'portal_addr','http://10.1.235.197:48080/skywalking/','string','默认门户地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1002,'servers_addr','10.1.235.197:34000;10.1.235.197:35000;','string','日志采集地址','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES (1003,'servers_addr_1','XXX.XXX.XXX.XXX:34000;','string','日志采集地址-外网','2015-12-10 15:23:53','A','2015-12-10 15:23:53'); -INSERT INTO `system_config` (`config_id`,`conf_key`,`conf_value`,`val_type`,`val_desc`,`create_time`,`sts`,`modify_time`) VALUES ('1004', 'alarm_type_info', '[{"type":"default","label":"exception","desc":"System Exception"},{"type":"ExecuteTime-PossibleError","label":"remark","desc":"Excution Time > 5s"},{"type":"ExecuteTime-Warning","label":"remark","desc":"Excution Time > 500ms"}]', 'json', '告警类型', '2016-04-18 16:04:51', 'A', '2016-04-18 16:04:53'); - -# init default value of auth_file_config -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('1', 'buriedpoint.printf', 'false', 'false', '是否打印数据', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('2', 'buriedpoint.max_exception_stack_length', '4000', '4000', '埋点异常的最大长度', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('3', 'buriedpoint.businesskey_max_length', '300', '300', '业务字段的最大长度', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('4', 'buriedpoint.exclusive_exceptions', '$exclusiveException', '$exclusiveException', '过滤异常', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('5', 'sender.connect_percent', '100', '100', '最大发送者的连接数阀比例', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('6', 'sender.servers_addr', '#servers_addr', '#servers_addr_1', '发送服务端配置', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('7', 'sender.max_copy_num', '2', '2', '最大发送的副本数量', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('8', 'sender.max_send_length', '20000', '20000', '发送的最大长度', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('9', 'sender.retry_get_sender_wait_interval', '2000', '2000', '当没有Sender时,尝试获取sender的等待周期', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('10', 'consumer.max_consumer', '2', '2', '最大消费线程数', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('11', 'consumer.max_wait_time', '5', '5', '消费者最大等待时间', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('12', 'consumer.consumer_fail_retry_wait_interval', '50', '50', '发送失败等待时间 ', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('13', 'buffer.buffer_max_size', '18000', '18000', '每个Buffer的最大个数', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('14', 'buffer.pool_size', '5', '5', 'Buffer池的最大长度', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('15', 'senderchecker.check_polling_time', '200', '200', '发送检查线程检查周期', 'A'); -INSERT INTO `auth_file_config` (`config_id`, `key`, `value0`, `value1`, `key_desc`, `sts`) VALUES ('16', 'skywalking.charset', 'UTF-8', 'UTF-8', 'skywalking数据编码', 'A'); -INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('17','plugin.customlocalmethodinterceptorplugin.is_enable','false','false',NULL,NULL,NULL,'自定义本地方法插件是否开启','A'); -INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('18','plugin.customlocalmethodinterceptorplugin.package_prefix','','',NULL,NULL,NULL,'自定义插件拦截的包前缀','A'); -INSERT INTO `auth_file_config` (`config_id`,`key`,`value0`,`value1`,`value2`,`value3`,`value4`,`key_desc`,`sts`) VALUES ('19','plugin.customlocalmethodinterceptorplugin.record_param_enable','false','false',NULL,NULL,NULL,'自定义插件是否记录入参',NULL); - - # alter table since 2016-4-8 ALTER TABLE `application_info` ADD COLUMN `update_time` DATETIME NULL AFTER `sts`, ADD COLUMN `app_desc` VARCHAR(1024) NULL AFTER `update_time`; -# alter table since 2016-5-26 -# 新增sw_chain_detail,用于调用链分析表 --- ----------------------------------------------------- --- Table `sw_chain_detail` --- ----------------------------------------------------- -CREATE TABLE `sw_chain_detail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `viewpoint` varchar(8192) COLLATE utf8_bin DEFAULT NULL, - `treeId` varchar(40) COLLATE utf8_bin DEFAULT NULL, - `uid` varchar(32) COLLATE utf8_bin DEFAULT NULL, - `traceLevelId` varchar(32) COLLATE utf8_bin DEFAULT NULL, - `create_time` timestamp NULL DEFAULT NULL, - `update_time` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `id_UNIQUE` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8146 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +