Skip to content

Commit

Permalink
Merge pull request #240 from scouter-contrib/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mindplates authored Oct 28, 2019
2 parents 8e10cfe + 619d42c commit 735c8ce
Show file tree
Hide file tree
Showing 47 changed files with 3,527 additions and 946 deletions.
Binary file added .deploy.enc
Binary file not shown.
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
addons:
ssh_known_hosts:
- demo.scouterapm.com
dist: xenial
language: node_js
node_js:
- "stable"
before_install:
- echo -e "Host $DEMO_SERVER_NODE\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- openssl aes-256-cbc -K $encrypted_d662ab6492f2_key -iv $encrypted_d662ab6492f2_iv -in .deploy.enc -out $DEMO_DELOY_FILE -d
- chmod 600 $DEMO_DELOY_FILE
- npm install
script :
- npm run-script build
after_success:
- tar cvf $SCOUTER_PAPER_COMPRESS_NAME build/
- echo "scp -i $DEMO_DELOY_FILE $SCOUTER_PAPER_COMPRESS_NAME $DEMO_SERVER_USER@$DEMO_SERVER_NODE:/home/$DEMO_SERVER_USER"
- scp -i $DEMO_DELOY_FILE $SCOUTER_PAPER_COMPRESS_NAME $DEMO_SERVER_USER@$DEMO_SERVER_NODE:/home/$DEMO_SERVER_USER
- ssh -i $DEMO_DELOY_FILE -T $DEMO_SERVER_USER@$DEMO_SERVER_NODE "/home/ec2-user/deploy.sh $SCOUTER_PAPER_COMPRESS_NAME"
cache:
directories:
- "node_modules"
branches:
only:
- development
notifications:
slack: scouterapm:fJndRYgbQA0uTLXiEqxZJhUU

#: construction_worker:
# job life cycle explain : https://docs.travis-ci.com/user/job-lifecycle/
# https://docs.travis-ci.com/user/encrypting-files
1 change: 1 addition & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PAPER_VERSION=2.5.0
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx:1.17.0-alpine
## url setting
LABEL maintainer="yosong.heo@gmail.com"
ARG INSTALL_URL=https://github.com/scouter-contrib/scouter-paper/releases/download/${PAPER_VERSION:-2.5.0}/scouter-paper-v${PAPER_VERSION:-2.5.0}.zip
RUN mkdir -p /var/www;
COPY default.conf /etc/nginx/conf.d/default.conf
## install
WORKDIR /var/www
RUN apk add -U tzdata wget unzip;cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime; wget ${INSTALL_URL};unzip scouter-paper-v${PAPER_VERSION:-2.5.0}.zip
13 changes: 13 additions & 0 deletions docker/HOWTO-Build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 1. 빌드 요구 사항
- docker version
- Docker version 18.09.6 이상
### 1.2 빌드
- .env 파일에 Scouter Paper 릴리스 버전 변경 후
```
$./build.sh
```
### 1.3 dockerhub 저장소에 Push

```
$./push.sh
```
6 changes: 6 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
source .env

echo ">>> build paper version $PAPER_VERSION"
export $PAPER_VERSION
docker build -t scouterapm/scouter-paper:$PAPER_VERSION .
50 changes: 50 additions & 0 deletions docker/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
server {
listen 80;
server_name localhost;
charset utf-8;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /var/www;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}


location ~* /\.(?!well-known\/)
{
deny all;
}

# Prevent clients from accessing to backup/config/source files
location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$
{
deny all;
}

#Prevent to log favicon.ico
location = /favicon.ico
{
access_log off;
log_not_found off;
}

#Prevent to log robots.txt
location = /robots.txt
{
access_log off;
log_not_found off;
}

}

7 changes: 7 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.2'
services:
scouter-paper:
image : scouterapm/scouter-paper:2.5.0
restart : always
ports:
- 8080:80
4 changes: 4 additions & 0 deletions docker/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
source .env
echo ">>> build paper version $PAPER_VERSION"
docker push scouterapm/scouter-paper:$PAPER_VERSION
45 changes: 45 additions & 0 deletions http/serviceMap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"-2608246922300427269" : {
"name" : "/traceability/cross-service/complex<GET>\n(/sc-api-demo-m01.localdomain/sampleweb)",
"error" : "",
"xtype" : "WEB_SERVICE",
"elapsed" : "485",
"threadName" : "http-nio-8080-exec-5",
"tag" : {
"caller" : "-2608246922300427269",
"ip": "172.31.31.84",
"serverId" : "scouter-demo-collector"
}
},
"-1561743063494029368" : {
"name" : "/traceability/cross-service/simple2<GET>\n(/sc-api-demo-m01.localdomain/sampleweb)",
"error" : "",
"xtype" : "WEB_SERVICE",
"threadName" : "http-nio-8080-exec-5",
"tag" : {
"caller" : "-2608246922300427269",
"ip": "172.31.31.84",
"serverId" : "scouter-demo-collector"
},
"childMap" : {
"210230" : {
"name" :"",
"error" :"",
"xtype" :"",
"threadName" :""
},
"210231" : {
"name" :"",
"error" :"",
"xtype" :"",
"address":"",
"threadName" :"",
"tag" :{
"serverId" : "scouter-demo-collector"
}
}
}
}
}


27 changes: 27 additions & 0 deletions http/tree.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "0.0.0.0",
"parent": "null",
"children": [
{
"name": "/traceability/cross-service/complex<GET>",
"parent": "0.0.0.0",
"children": [
{
"name": "/traceability/cross-service/simple2<GET>",
"parent": "/traceability/cross-service/complex<GET>"
},
{
"name": "/traceability/cross-service/simple<GET>",
"parent": "/traceability/cross-service/complex<GET>"
},
{

}
]
},
{
"name": "Level 2: B",
"parent": "Top Level"
}
]
}
74 changes: 74 additions & 0 deletions http/xflow.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// XLogDataController.java
// SingleXLogRequest
GET http://demo.scouterapm.com:6188/scouter/v1/xlog-data/{yyyymmdd}/{txid}
#
###
#"result": [
# {
# "endTime": "1571082075636",
# "objHash": "1026166527",
# "service": "http:/traceability/cross-service/simple2",
# "txid": "6990900342269582982",
# "threadName": "",
# "caller": "899870199175109144",
# "gxid": "899870199175109144",
# "elapsed": "578",
# "error": "",
# "cpu": "0",
# "sqlCount": "0",
# "sqlTime": "0",
# "ipAddr": "0.0.0.0",
# "allocatedMemory": "0",
# "internalId": "0",
# "userAgent": "",
# "referrer": "",
# "group": "",
# "apicallCount": "0",
# "apicallTime": "0",
# "countryCode": "",
# "city": "",
# "login": "",
# "desc": "",
# "hasDump": "0",
# "text1": "ip-172-31-21-206.ap-northeast-2.compute.internal:ScouterDemoWeb",
# "text2": "",
# "text3": "",
# "text4": "",
# "text5": "",
# "queuingHost": "",
# "queuingTime": "0",
# "queuing2ndHost": "",
# "queuing2ndTime": "0",
# "xlogType": "ZIPKIN_SPAN"
# },
GET http://demo.scouterapm.com:6188/scouter/v1/profile-data/20191017/6506185853545897725
###
#"result": [
# {
# "mainValue": "[driving thread] http-nio-8080-exec-21",
# "additionalValueList": [],
# "step": {
# "parent": "-1",
# "index": "0",
# "start_time": "0",
# "start_cpu": "0",
# "spanPack": null,
# "hash": "1712797862",
# "time": "-1",
# "value": "0",
# "stepType": "9",
# "order": "0",
# "stepTypeName": "HASHED_MESSAGE"
# }
# },

GET http://demo.scouterapm.com:6188/scouter/v1/xlog/20191017/374225541302635030

###

GET http://demo.scouterapm.com:6188/scouter/v1/xlog-data/20191017/-854231684852475423

###
GET http://demo.scouterapm.com:6188/scouter/v1/dictionary/20191020?dictKeys=[table:566700965]

###
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"autoprefixer": "7.1.6",
"axios": "^0.17.1",
"axios": "^0.18.1",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
Expand All @@ -20,9 +20,10 @@
"css-loader": "0.28.7",
"d3": "^4.12.0",
"d3-scale-chromatic": "^1.3.3",
"d3-tip": "^0.9.1",
"detect-browser": "^2.1.0",
"dotenv": "4.0.0",
"eslint": "4.10.0",
"eslint": "^4.18.2",
"eslint-config-react-app": "^2.0.1",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
Expand All @@ -36,7 +37,7 @@
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"jquery": "^3.2.1",
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"moment": "^2.23.0",
"numeral": "^2.0.6",
"object-assign": "4.1.1",
Expand Down
22 changes: 22 additions & 0 deletions src/Theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ html.theme-gray {
stroke: #deffba;
}

/* THEME, topology-chart.css */
.theme-gray .topology-wrapper .tooltip-group{
color: #111;
}

/* THEME, Login.css */
.theme-gray .login-wrapper .login-box {
Expand Down Expand Up @@ -346,3 +350,21 @@ html.theme-gray, .theme-gray body {
background-color: #111;
}

.theme-gray div.xlog-flow > div.contents {
background-color: #666;
}
.theme-gray div.xlog-flow-content > div.contents > div.flow-data span{
color : #333;
}
.theme-gray div.xlog-flow-content > div.contents > div.flow-data span.data.txid {
color : #7B3E81;
}
.theme-gray div.xlog-flow-content > div.contents > div.type > div.info{
color : #333;
}
.theme-gray div.xlog-flow-content > div.contents > div.error > div.info{
color : red;
}
.theme-gray div.active-speed-content > div.row:hover{
color : #333;
}
38 changes: 38 additions & 0 deletions src/common/ElementType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export default class ElementType {

static defaultProps = {
USER : "0",
SERVICE : "1",
API_CALL : "2",
SQL : "3",
DISPATCH : "4",
THREAD : "5",

toString(value) {
switch(value){
case this.USER : return "USER";
case this.SERVICE : return "SERVICE";
case this.API_CALL : return "API_CALL";
case this.SQL : return "SQL";
case this.DISPATCH : return "DISPATCH";
case this.THREAD : return "THREAD";
default:
return "UNKNOWN";
}
}
,
toColor(value){
switch(value){
case this.USER : return "#aeaeae";
case this.SERVICE : return "#6e40aa";
case this.API_CALL : return "#417de0";
case this.SQL : return "#1ac7c2";
case this.DISPATCH : return "#c9510c";
case this.THREAD : return "#76b852";
default:
return "#003666";
}
}
};
}

2 changes: 1 addition & 1 deletion src/common/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// local storage access
import moment from "moment";
import {Dictionary, DictType} from "./dictionary";
export const version = "2.5.0";
export const version = "2.6.0";

export function getData(key) {
let ls = null;
Expand Down
2 changes: 1 addition & 1 deletion src/common/idAbbr.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function toString32(num) {
const minus = num < 0;

if (minus) {
let rad32 = MINUS + (-1 * num).toString(32);
let rad32 = MINUS + (-num).toString(32);
return rad32;

} else {
Expand Down
Loading

0 comments on commit 735c8ce

Please sign in to comment.