Skip to content

Commit

Permalink
Conflict: 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
rrgks6221 committed Aug 7, 2022
2 parents f5aaa09 + d02e19b commit f0d4818
Show file tree
Hide file tree
Showing 14 changed files with 691 additions and 44 deletions.
48 changes: 48 additions & 0 deletions TimeSericesData/7DayTSD-Certification-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
marp: false
date: 2022. 07. 24
author: 박종범<[email protected]>
version: 1
---

# 7DayTSD-Certification-report


## 개요
Uncloud graph의 Prometheus-Exporter의 시계열 데이터에 대한 시간연속성 테스트

### 절차
- 24Hour별 데이터 일관성 확인
- 신규 이슈에 대한 체크

### 수집 시작 시간
- 2022:07:17 08:34:28
<img width="1187" alt="스크린샷 2022-07-24 오후 2 14 10" src="https://user-images.githubusercontent.com/49029142/180633252-bf2d770b-e88c-4ba5-abf7-37a0ff0221d3.png">

### 24Hour별 데이터 일관성 검증
- 특정 시간 기준으로 1시간 단위 데이터의 연속성 비교

<img width="1180" alt="스크린샷 2022-07-24 오후 2 16 39" src="https://user-images.githubusercontent.com/49029142/180633305-3f9f29f8-0c15-4194-9081-30b1068609a1.png">

2022-07-18 12:00:00 데이터

<img width="1183" alt="스크린샷 2022-07-24 오후 2 16 51" src="https://user-images.githubusercontent.com/49029142/180633323-b3574baf-617b-4b31-97c2-0375e866a2d9.png">

2022-07-18 13:00:00 데이터

<img width="1186" alt="스크린샷 2022-07-24 오후 2 16 59" src="https://user-images.githubusercontent.com/49029142/180633339-97aa450f-fb9b-455b-9275-5728cdf33708.png">

2022-07-18 14:00:00 데이터

### 결론
1시간 단위 일관성 있는 데이터 제공 -> 백엔드 서버의 메트릭 생성으로 신규값 제공

### 신규 이슈 - TSDB 용량 문제
<img width="389" alt="스크린샷 2022-07-24 오후 2 29 39" src="https://user-images.githubusercontent.com/49029142/180633748-43597bfc-402e-4f09-ab70-b002ae6f5bd9.png">

현재 인스턴스에 할당된 스토리지: 20GB
<img width="1455" alt="스크린샷 2022-07-24 오후 2 23 46" src="https://user-images.githubusercontent.com/49029142/180633751-53d600ff-4ac0-43f2-8d61-beacbdb2a2b7.png">

사용량: 2022-07-23 14:30:00 (17.97%) ~ 2022-07-24 14:30:00 (17.99%)

=> 1년이상 사용가능, 추후 NAS를 활용한 증설가능
45 changes: 20 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,22 @@ const swaggerUi = require('swagger-ui-express');

const spec = require('./swagger/swagger.json');

const { customPodCpuUsage } = require('./metric/pod/customPodCpuUsage');
const { customPodMemoryUsage } = require('./metric/pod/customPodMemoryUsage');
const {
customPodMemoryUsageBytes,
} = require('./metric/pod/customPodMemoryUsageBytes');
const { customPodTotalMemory } = require('./metric/pod/customPodTotalMemory');

const { customNodeCpuTotal } = require('./metric/node/customNodeCpuTotal');
const { customNodeCpuUsage } = require('./metric/node/customNodeCpuUsage');
const {
customNodeTotalMemory,
} = require('./metric/node/customNodeTotalMemory');
const { customPodDiskLatency } = require('./metric/pod/customPodDiskLatency');
const {
customNodeDiskLatency,
} = require('./metric/node/customNodeDiskLatency');
const {
customNodeCpuUsage,
customNodeCpuSpec,
customNodeMemorySpec,
customNodeMemoryUsageBytes,
customNodeMemoryUsage,
} = require('./metric/node/customNodeMemoryUsage');
customNodeDiskLatency,
} = require('./metric/node/index.js');
const {
customNodeMemoryUsageBytes,
} = require('./metric/node/customNodeMemoryUsageBytes');
customPodCpuUsage,
customPodCpuSpec,
customPodMemorySpec,
customPodMemoryUsageBytes,
customPodMemoryUsage,
customPodDiskLatency,
} = require('./metric/pod/index.js');

const app = express();

Expand All @@ -36,18 +30,19 @@ const register = new client.Registry();

// pod metrics
customPodCpuUsage(register);
customPodMemoryUsage(register);
customPodCpuSpec(register);
customPodMemorySpec(register);
customPodMemoryUsageBytes(register);
customPodTotalMemory(register);
customPodMemoryUsage(register);
customPodDiskLatency(register);

// node metrics
customNodeCpuTotal(register);
customNodeCpuUsage(register);
customNodeDiskLatency(register);
customNodeMemoryUsage(register);
customNodeCpuSpec(register);
customNodeMemorySpec(register);
customNodeMemoryUsageBytes(register);
customNodeTotalMemory(register);
customNodeMemoryUsage(register);
customNodeDiskLatency(register);

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(spec));

Expand Down
94 changes: 94 additions & 0 deletions metric/constants/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,104 @@ const METRIC_NAME = {
CUSTOM_NODE_MEMORY_USAGE: 'custom_node_memory_usage',
CUSTOM_NODE_MEMORY_USAGE_BYTES: 'custom_node_memory_usage_bytes',
CUSTOM_NODE_TOTAL_MEMORY: 'custom_node_total_memory',
CUSTOM_NODE_CPU_SPEC: 'custom_node_cpu_spec',
CUSTOM_NODE_MEMORY_SPEC: 'custom_node_memory_spec',
// pod
CUSTOM_POD_CPU_USAGE: 'custom_pod_cpu_usage',
CUSTOM_POD_DISK_LATENCY: 'custom_pod_disk_latency',
CUSTOM_POD_MEMORY_USAGE: 'custom_pod_memory_usage',
CUSTOM_POD_MEMORY_USAGE_BYTES: 'custom_pod_memory_usage_bytes',
CUSTOM_POD_TOTAL_MEMORY: 'custom_pod_total_memory',
CUSTOM_POD_CPU_SPEC: 'custom_pod_cpu_spec',
CUSTOM_POD_MEMORY_SPEC: 'custom_pod_memory_spec',
};

NODE_CPU_SPEC = {
seoulb01: 0.27200367274864656,
seoulm01: 1.2391869241961915,
seoulh01: 0.3110475499304459,
seouln01: 0.7982030505316182,
seoulm02: 1.0054712605507794,
seoulh02: 0.7330881611452804,
seouln02: 0.8919479989487205,
seoulm03: 0.3832627524988117,
seoulh03: 0.7415142038819986,
seouln03: 0.7392414970975074,
seouln04: 0.496165066916757,
seouln05: 0.2625388209996633,
busanb01: 0.31695570660860084,
busanm01: 1.0139438889462329,
busanh01: 0.9036378217305587,
busann01: 0.7346252318626028,
busanm02: 0.560526797654193,
busanh02: 0.799851029961884,
busann02: 0.344184858552979,
busanm03: 1.1273953263949343,
busanh03: 0.3611079328428055,
busann03: 0.2725390163978476,
busann04: 0.7529561042124144,
busann05: 1.1258006567088377,
};

POD_CPU_SPEC = {
'seouln01-swagger-deployment-1771418926-7o5ns': 1.0794165482681501,
'seouln03-swagger-deployment-1771418926-r18ao': 0.618699888195432,
'seouln05-nodejs-deployment-2231392811-38d2a': 0.6894158098338163,
'seouln02-nodejs-deployment-2231392811-2dzos': 1.1021442358480202,
'seouln04-nodejs-deployment-2231392811-29dcs': 0.841997890658458,
'seouln01-nodejs-deployment-2231392811-9jdsi': 0.8761918460460174,
'seouln02-mariadb-deployment-2913201382-9sjwa': 0.6286478448532531,
'seouln03-mariadb-deployment-2913201382-2sadw': 1.0339310206743388,
'seouln05-zandi-grapher-deployment-9442134208-9dxw2': 1.0345505925811154,
'seouln05-zandi-grapher-deployment-9442134208-23jfd': 0.48809650378119773,
'seouln03-zandi-grapher-deployment-9442134208-e29aw': 1.0979750367099894,
'seouln01-zandi-grapher-deployment-9442134208-5djwu': 0.43347916524919183,
'seouln05-nodejs-deployment-3942392102-d392a': 1.0144859796159291,
'seouln01-nodejs-deployment-3942392102-93fhs': 0.697137310742209,
'seouln04-nodejs-deployment-3942392102-8dhwu': 0.6965973095914688,
'seouln05-nodejs-deployment-3942392102-i28e3': 1.1129865482490333,
'seouln03-mysql-deployment-7532913428-d48da': 1.0730308871915046,
'seouln01-mysql-deployment-7532913428-8saiw': 0.5658909522475488,
'seouln02-mysql-deployment-7532913428-9dwja': 1.1202370359888494,
'seouln01-uncloudy-grapher-blue-deployment-3291203292-0ad92': 1.0001659756877048,
'seouln04-uncloudy-grapher-blue-deployment-3291203292-8sjaw': 1.1774858178732797,
'seouln03-uncloudy-grapher-green-deployment-7253917392-38udh': 0.510521821599107,
'seouln04-uncloudy-grapher-green-deployment-7253917392-d82hw': 0.3262120170344198,
'seouln04-monitoring-agent-deployment-8573293182-9dwqa': 1.111696070837028,
'seouln03-monitoring-agent-deployment-8573293182-vcus1': 0.2871128053427747,
'seouln02-monitoring-agent-deployment-8573293182-dehy2': 0.7484964926356474,
'seouln02-prometheus-deployment-8347123928-d9a8w': 0.5288497440047284,
'seouln04-prometheus-deployment-8347123928-vn28a': 1.2239823051081575,
'seouln01-grafana-deployment-5738192321-9sj2a': 0.8901003738457474,
'busann01-swagger-deployment-1771418926-7o5ns': 0.7267718466590378,
'busann05-swagger-deployment-1771418926-r18ao': 0.8812279069250939,
'busann01-nodejs-deployment-2231392811-38d2a': 0.28645918646464663,
'busann03-nodejs-deployment-2231392811-2dzos': 0.7138947090367973,
'busann02-nodejs-deployment-2231392811-29dcs': 0.9484801056587906,
'busann05-nodejs-deployment-2231392811-9jdsi': 0.7175037505229185,
'busann03-mariadb-deployment-2913201382-9sjwa': 0.6170209164642086,
'busann02-mariadb-deployment-2913201382-2sadw': 0.6149436790576708,
'busann05-zandi-grapher-deployment-9442134208-9dxw2': 0.25112211742166934,
'busann01-zandi-grapher-deployment-9442134208-23jfd': 0.6819260361223918,
'busann04-zandi-grapher-deployment-9442134208-e29aw': 0.6976101530264966,
'busann05-zandi-grapher-deployment-9442134208-5djwu': 1.0579731254028806,
'busann04-nodejs-deployment-3942392102-d392a': 1.1871595772248125,
'busann01-nodejs-deployment-3942392102-93fhs': 0.5631366302682981,
'busann04-nodejs-deployment-3942392102-8dhwu': 1.2032002563441404,
'busann01-nodejs-deployment-3942392102-i28e3': 0.8422734978125292,
'busann02-mysql-deployment-7532913428-d48da': 0.9734384839696351,
'busann02-mysql-deployment-7532913428-8saiw': 0.5121528421006647,
'busann03-mysql-deployment-7532913428-9dwja': 0.904192133498205,
'busann03-uncloudy-grapher-blue-deployment-3291203292-0ad92': 1.2014949433215514,
'busann05-uncloudy-grapher-blue-deployment-3291203292-8sjaw': 0.5546392319100939,
'busann02-uncloudy-grapher-green-deployment-7253917392-38udh': 0.5685318633384844,
'busann05-uncloudy-grapher-green-deployment-7253917392-d82hw': 0.6765875151673066,
'busann04-monitoring-agent-deployment-8573293182-9dwqa': 0.4584337518980377,
'busann04-monitoring-agent-deployment-8573293182-vcus1': 1.046454617541513,
'busann05-monitoring-agent-deployment-8573293182-dehy2': 0.8510848765132875,
'busann01-prometheus-deployment-8347123928-d9a8w': 0.3176266268329917,
'busann03-prometheus-deployment-8347123928-vn28a': 0.4872352723405089,
'busann02-grafana-deployment-5738192321-9sj2a': 0.6918236449996984,
};

module.exports = {
Expand All @@ -44,4 +136,6 @@ module.exports = {
INSTANCE_TYPE,
RANGE_TYPE,
METRIC_NAME,
NODE_CPU_SPEC,
POD_CPU_SPEC,
};
4 changes: 2 additions & 2 deletions metric/constants/labelName.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const POD_LABEL_NAMES = ['pod', 'namespace', 'instance', 'deployment'];
const NODE_LABEL_NAMES = ['container', 'cluster', 'instance'];
const POD_LABEL_NAMES = ['pod', 'namespace', 'instance', 'deployment', 'os'];
const NODE_LABEL_NAMES = ['container', 'cluster', 'instance', 'os'];

module.exports = {
POD_LABEL_NAMES,
Expand Down
24 changes: 24 additions & 0 deletions metric/constants/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,121 +3,145 @@ const nodes = [
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulb01',
os: 'rhel7',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulm01',
os: 'rhel8',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulh01',
os: 'ubuntu',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seouln01',
os: 'rhcos7',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulm02',
os: 'centos7',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulh02',
os: 'centos8',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seouln02',
os: 'rhcos8',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulm03',
os: 'ubuntu',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seoulh03',
os: 'centos7',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seouln03',
os: 'centos8',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seouln04',
os: 'rhcos7',
},
{
container: 'nodejs',
cluster: 'seoul',
instance: 'seouln05',
os: 'rhcos8',
},
{
container: 'nodejs',
cluster: 'busanoul',
instance: 'busanb01',
os: 'rhel8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanm01',
os: 'rhel7',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanh01',
os: 'rhel7',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busann01',
os: 'rhel8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanm02',
os: 'rhcos7',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanh02',
os: 'rhcos8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busann02',
os: 'centos7',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanm03',
os: 'centos8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busanh03',
os: 'ubuntu',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busann03',
os: 'rhel8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busann04',
os: 'centos8',
},
{
container: 'nodejs',
cluster: 'busan',
instance: 'busann05',
os: 'ubuntu',
},
];

Expand Down
Loading

0 comments on commit f0d4818

Please sign in to comment.