From f261fe1e5b17cd631beebacbe1734705e6862fa8 Mon Sep 17 00:00:00 2001 From: lsh Date: Sat, 16 Jul 2022 19:57:09 +0900 Subject: [PATCH 1/6] Add: node-exporter #1 --- .gitignore | 1 + index.js | 45 + metric/common/getMetricConfig.js | 10 + metric/common/randomValue.js | 12 + metric/constants/labelName.js | 7 + metric/constants/nodes.js | 124 +++ metric/constants/pods.js | 297 +++++++ metric/node/customNodeCpuTotal.js | 23 + metric/node/customNodeCpuUsage.js | 23 + metric/node/customNodeTotalMemory.js | 23 + metric/pod/customPodCpuUsage.js | 20 + metric/pod/customPodMemoryUsage.js | 23 + metric/pod/customPodMemoryUsageBytes.js | 23 + metric/pod/customPodTotalMemory.js | 23 + package-lock.json | 1064 +++++++++++++++++++++++ package.json | 16 + 16 files changed, 1734 insertions(+) create mode 100644 .gitignore create mode 100644 index.js create mode 100644 metric/common/getMetricConfig.js create mode 100644 metric/common/randomValue.js create mode 100644 metric/constants/labelName.js create mode 100644 metric/constants/nodes.js create mode 100644 metric/constants/pods.js create mode 100644 metric/node/customNodeCpuTotal.js create mode 100644 metric/node/customNodeCpuUsage.js create mode 100644 metric/node/customNodeTotalMemory.js create mode 100644 metric/pod/customPodCpuUsage.js create mode 100644 metric/pod/customPodMemoryUsage.js create mode 100644 metric/pod/customPodMemoryUsageBytes.js create mode 100644 metric/pod/customPodTotalMemory.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..8c2d130 --- /dev/null +++ b/index.js @@ -0,0 +1,45 @@ +const client = require('prom-client'); +const express = require('express'); + +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 app = express(); + +// Create a Registry to register the metrics +const register = new client.Registry(); + +// Other custom metrics and its usage + +// pod metrics +customPodCpuUsage(register); +customPodMemoryUsage(register); +customPodMemoryUsageBytes(register); +customPodTotalMemory(register); + +// node metrics +customNodeCpuTotal(register); +customNodeCpuUsage(register); +customNodeTotalMemory(register); + +app.get('/metrics', async (req, res) => { + res.setHeader('Content-Type', register.contentType); + res.send(await register.metrics()); +}); + +// Start the Express server and listen to a port +app.listen(8080, () => { + console.log( + 'Server is running on http://localhost:8080, metrics are exposed on http://localhost:8080/metrics' + ); +}); diff --git a/metric/common/getMetricConfig.js b/metric/common/getMetricConfig.js new file mode 100644 index 0000000..5a8d946 --- /dev/null +++ b/metric/common/getMetricConfig.js @@ -0,0 +1,10 @@ +const getMetricConfig = (name, labelNames) => { + return { + name, + labelNames, + help: 'This is my gauge', + buckets: [0.1, 0.3, 0.5, 0.7, 1, 3, 5, 7, 10], + }; +}; + +module.exports = getMetricConfig; diff --git a/metric/common/randomValue.js b/metric/common/randomValue.js new file mode 100644 index 0000000..304355e --- /dev/null +++ b/metric/common/randomValue.js @@ -0,0 +1,12 @@ +const getRandomValue = ({ range, isInteger }) => { + let min = range.min; + let max = range.max; + + if (isInteger) { + return Math.random() * (max - min) + min; + } + + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min)) + min; +}; diff --git a/metric/constants/labelName.js b/metric/constants/labelName.js new file mode 100644 index 0000000..7e1154a --- /dev/null +++ b/metric/constants/labelName.js @@ -0,0 +1,7 @@ +const POD_LABEL_NAMES = ['pod', 'namespace', 'instance']; +const NODE_LABEL_NAMES = ['container', 'cluster', 'instance']; + +module.exports = { + POD_LABEL_NAMES, + NODE_LABEL_NAMES, +}; diff --git a/metric/constants/nodes.js b/metric/constants/nodes.js new file mode 100644 index 0000000..5212db4 --- /dev/null +++ b/metric/constants/nodes.js @@ -0,0 +1,124 @@ +const nodes = [ + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulb01', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulm01', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulh01', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seouln01', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulm02', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulh02', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seouln02', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulm03', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seoulh03', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seouln03', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seouln04', + }, + { + container: 'nodejs', + cluster: 'seoul', + instance: 'seouln05', + }, + { + container: 'nodejs', + cluster: 'busanoul', + instance: 'busanb01', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanm01', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanh01', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busann01', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanm02', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanh02', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busann02', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanm03', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busanh03', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busann03', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busann04', + }, + { + container: 'nodejs', + cluster: 'busan', + instance: 'busann05', + }, +]; + +module.exports = { nodes }; diff --git a/metric/constants/pods.js b/metric/constants/pods.js new file mode 100644 index 0000000..876ead9 --- /dev/null +++ b/metric/constants/pods.js @@ -0,0 +1,297 @@ +const pods = [ + // seoul + { + namespace: 'zandi-backend', + pod: 'swagger-deployment-1771418926-7o5ns', + instance: 'seouln01', + }, + { + namespace: 'zandi-backend', + pod: 'swagger-deployment-1771418926-r18ao', + instance: 'seouln03', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-38d2a', + instance: 'seouln05', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-2dzos', + instance: 'seouln02', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-29dcs', + instance: 'seouln04', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-9jdsi', + instance: 'seouln01', + }, + { + namespace: 'zandi-backend', + pod: 'mariadb-deployment-2913201382-9sjwa', + instance: 'seouln02', + }, + { + namespace: 'zandi-backend', + pod: 'mariadb-deployment-2913201382-2sadw', + instance: 'seouln03', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-9dxw2', + instance: 'seouln05', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-23jfd', + instance: 'seouln05', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-e29aw', + instance: 'seouln03', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-5djwu', + instance: 'seouln01', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-d392a', + instance: 'seouln05', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-93fhs', + instance: 'seouln01', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-8dhwu', + instance: 'seouln04', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-i28e3', + instance: 'seouln05', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-d48da', + instance: 'seouln03', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-8saiw', + instance: 'seouln01', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-9dwja', + instance: 'seouln02', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-blue-deployment-3291203292-0ad92', + instance: 'seouln01', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-blue-deployment-3291203292-8sjaw', + instance: 'seouln04', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-green-deployment-7253917392-38udh', + instance: 'seouln03', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-green-deployment-7253917392-d82hw', + instance: 'seouln04', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-9dwqa', + instance: 'seouln04', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-vcus1', + instance: 'seouln03', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-dehy2', + instance: 'seouln02', + }, + { + namespace: 'infra', + pod: 'prometheus-deployment-8347123928-d9a8w', + instance: 'seouln02', + }, + { + namespace: 'infra', + pod: 'prometheus-deployment-8347123928-vn28a', + instance: 'seouln04', + }, + { + namespace: 'infra', + pod: 'grafana-deployment-5738192321-9sj2a', + instance: 'seouln01', + }, + + // busan + { + namespace: 'zandi-backend', + pod: 'swagger-deployment-1771418926-7o5ns', + instance: 'busann01', + }, + { + namespace: 'zandi-backend', + pod: 'swagger-deployment-1771418926-r18ao', + instance: 'busann05', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-38d2a', + instance: 'busann01', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-2dzos', + instance: 'busann03', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-29dcs', + instance: 'busann02', + }, + { + namespace: 'zandi-backend', + pod: 'nodejs-deployment-2231392811-9jdsi', + instance: 'busann05', + }, + { + namespace: 'zandi-backend', + pod: 'mariadb-deployment-2913201382-9sjwa', + instance: 'busann03', + }, + { + namespace: 'zandi-backend', + pod: 'mariadb-deployment-2913201382-2sadw', + instance: 'busann02', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-9dxw2', + instance: 'busann05', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-23jfd', + instance: 'busann01', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-e29aw', + instance: 'busann04', + }, + { + namespace: 'zandi-frontend', + pod: 'zandi-grapher-deployment-9442134208-5djwu', + instance: 'busann05', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-d392a', + instance: 'busann04', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-93fhs', + instance: 'busann01', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-8dhwu', + instance: 'busann04', + }, + { + namespace: 'uncloudy-backend', + pod: 'nodejs-deployment-3942392102-i28e3', + instance: 'busann01', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-d48da', + instance: 'busann02', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-8saiw', + instance: 'busann02', + }, + { + namespace: 'uncloudy-backend', + pod: 'mysql-deployment-7532913428-9dwja', + instance: 'busann03', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-blue-deployment-3291203292-0ad92', + instance: 'busann03', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-blue-deployment-3291203292-8sjaw', + instance: 'busann05', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-green-deployment-7253917392-38udh', + instance: 'busann02', + }, + { + namespace: 'uncloudy-frontend', + pod: 'uncloudy-grapher-green-deployment-7253917392-d82hw', + instance: 'busann05', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-9dwqa', + instance: 'busann04', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-vcus1', + instance: 'busann04', + }, + { + namespace: 'infra', + pod: 'monitoring-agent-deployment-8573293182-dehy2', + instance: 'busann05', + }, + { + namespace: 'infra', + pod: 'prometheus-deployment-8347123928-d9a8w', + instance: 'busann01', + }, + { + namespace: 'infra', + pod: 'prometheus-deployment-8347123928-vn28a', + instance: 'busann03', + }, + { + namespace: 'infra', + pod: 'grafana-deployment-5738192321-9sj2a', + instance: 'busann02', + }, +]; + +module.exports = { pods }; diff --git a/metric/node/customNodeCpuTotal.js b/metric/node/customNodeCpuTotal.js new file mode 100644 index 0000000..ceebee6 --- /dev/null +++ b/metric/node/customNodeCpuTotal.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeCpuTotal = (register) => { + const metricConfig = getMetricConfig( + 'custom_node_cpu_total', + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customNodeCpuTotal }; diff --git a/metric/node/customNodeCpuUsage.js b/metric/node/customNodeCpuUsage.js new file mode 100644 index 0000000..4015505 --- /dev/null +++ b/metric/node/customNodeCpuUsage.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeCpuUsage = (register) => { + const metricConfig = getMetricConfig( + 'custom_node_cpu_usage', + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customNodeCpuUsage }; diff --git a/metric/node/customNodeTotalMemory.js b/metric/node/customNodeTotalMemory.js new file mode 100644 index 0000000..25c5d02 --- /dev/null +++ b/metric/node/customNodeTotalMemory.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeTotalMemory = (register) => { + const metricConfig = getMetricConfig( + 'custom_node_total_memory', + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customNodeTotalMemory }; diff --git a/metric/pod/customPodCpuUsage.js b/metric/pod/customPodCpuUsage.js new file mode 100644 index 0000000..b091fd2 --- /dev/null +++ b/metric/pod/customPodCpuUsage.js @@ -0,0 +1,20 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { POD_LABEL_NAMES } = require('../constants/labelName'); +const { pods } = require('../constants/pods'); + +const customPodCpuUsage = (register) => { + const metricConfig = getMetricConfig('custom_pod_cpu_usage', POD_LABEL_NAMES); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + pods.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customPodCpuUsage }; diff --git a/metric/pod/customPodMemoryUsage.js b/metric/pod/customPodMemoryUsage.js new file mode 100644 index 0000000..730b896 --- /dev/null +++ b/metric/pod/customPodMemoryUsage.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { POD_LABEL_NAMES } = require('../constants/labelName'); +const { pods } = require('../constants/pods'); + +const customPodMemoryUsage = (register) => { + const metricConfig = getMetricConfig( + 'custom_pod_memory_usage', + POD_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + pods.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customPodMemoryUsage }; diff --git a/metric/pod/customPodMemoryUsageBytes.js b/metric/pod/customPodMemoryUsageBytes.js new file mode 100644 index 0000000..a3b025f --- /dev/null +++ b/metric/pod/customPodMemoryUsageBytes.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { POD_LABEL_NAMES } = require('../constants/labelName'); +const { pods } = require('../constants/pods'); + +const customPodMemoryUsageBytes = (register) => { + const metricConfig = getMetricConfig( + 'custom_pod_memory_usage_bytes', + POD_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + pods.forEach((pod) => { + g.set(pod, parseInt(Math.random() * (Math.random() * 10000000))); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customPodMemoryUsageBytes }; diff --git a/metric/pod/customPodTotalMemory.js b/metric/pod/customPodTotalMemory.js new file mode 100644 index 0000000..e64f5d0 --- /dev/null +++ b/metric/pod/customPodTotalMemory.js @@ -0,0 +1,23 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const { POD_LABEL_NAMES } = require('../constants/labelName'); +const { pods } = require('../constants/pods'); + +const customPodTotalMemory = (register) => { + const metricConfig = getMetricConfig( + 'custom_pod_total_memory', + POD_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + pods.forEach((pod) => { + g.set(pod, Math.random()); + }); + }, 100); + + register.registerMetric(g); +}; + +module.exports = { customPodTotalMemory }; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..578f958 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1064 @@ +{ + "name": "prom-client", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "prom-client", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.18.1", + "prom-client": "^14.0.1" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/bintrees": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==" + }, + "node_modules/body-parser": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.0", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.10.3", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/prom-client": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz", + "integrity": "sha512-HxTArb6fkOntQHoRGvv4qd/BkorjliiuO2uSWC2KC17MUTKYttWdDoXX/vxOhQdkoECEM9BBH0pj2l8G8kev6w==", + "dependencies": { + "tdigest": "^0.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/tdigest": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", + "dependencies": { + "bintrees": "1.0.2" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + }, + "dependencies": { + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "bintrees": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==" + }, + "body-parser": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "express": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.0", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.10.3", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "prom-client": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz", + "integrity": "sha512-HxTArb6fkOntQHoRGvv4qd/BkorjliiuO2uSWC2KC17MUTKYttWdDoXX/vxOhQdkoECEM9BBH0pj2l8G8kev6w==", + "requires": { + "tdigest": "^0.1.1" + } + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + }, + "tdigest": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", + "requires": { + "bintrees": "1.0.2" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..86770f4 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "prom-client", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.18.1", + "prom-client": "^14.0.1" + } +} From 025be73d3916501dbd9102c374171a9e332a1111 Mon Sep 17 00:00:00 2001 From: lsh Date: Sat, 23 Jul 2022 20:43:08 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20metric=20range=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 14 + metric/common/randomValue.js | 37 +- metric/constants/common.js | 47 ++ metric/constants/range.js | 82 ++++ metric/node/customNodeCpuTotal.js | 9 +- metric/node/customNodeCpuUsage.js | 15 +- metric/node/customNodeDiskLatency.js | 33 ++ metric/node/customNodeMemoryUsage.js | 33 ++ metric/node/customNodeMemoryUsageBytes.js | 33 ++ metric/node/customNodeTotalMemory.js | 9 +- metric/pod/customPodCpuUsage.js | 16 +- metric/pod/customPodDiskLatency.js | 30 ++ metric/pod/customPodMemoryUsage.js | 13 +- metric/pod/customPodMemoryUsageBytes.js | 16 +- metric/pod/customPodTotalMemory.js | 5 +- package-lock.json | 573 ++++++++++++++++++++++ package.json | 2 + 17 files changed, 936 insertions(+), 31 deletions(-) create mode 100644 metric/constants/common.js create mode 100644 metric/constants/range.js create mode 100644 metric/node/customNodeDiskLatency.js create mode 100644 metric/node/customNodeMemoryUsage.js create mode 100644 metric/node/customNodeMemoryUsageBytes.js create mode 100644 metric/pod/customPodDiskLatency.js diff --git a/index.js b/index.js index 8c2d130..5ad430a 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,16 @@ 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 { + customNodeMemoryUsage, +} = require('./metric/node/customNodeMemoryUsage'); +const { + customNodeMemoryUsageBytes, +} = require('./metric/node/customNodeMemoryUsageBytes'); const app = express(); @@ -26,10 +36,14 @@ customPodCpuUsage(register); customPodMemoryUsage(register); customPodMemoryUsageBytes(register); customPodTotalMemory(register); +customPodDiskLatency(register); // node metrics customNodeCpuTotal(register); customNodeCpuUsage(register); +customNodeDiskLatency(register); +customNodeMemoryUsage(register); +customNodeMemoryUsageBytes(register); customNodeTotalMemory(register); app.get('/metrics', async (req, res) => { diff --git a/metric/common/randomValue.js b/metric/common/randomValue.js index 304355e..2881c62 100644 --- a/metric/common/randomValue.js +++ b/metric/common/randomValue.js @@ -1,12 +1,33 @@ -const getRandomValue = ({ range, isInteger }) => { - let min = range.min; - let max = range.max; +const { + NODE_TOTAL_BYTE, + POD_TOTAL_BYTE, + RANGE_TYPE, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); +const RANGE = require('../constants/range'); - if (isInteger) { - return Math.random() * (max - min) + min; +const getRandomValue = (instanceType, resourceName) => { + const isNormal = Math.random() > 0.03; + const rangeType = isNormal ? RANGE_TYPE.NORMAL : RANGE_TYPE.OVERLOAD; + const totalByte = + instanceType === INSTANCE_TYPE.NODE ? NODE_TOTAL_BYTE : POD_TOTAL_BYTE; + const { start, end } = RANGE[rangeType][instanceType][resourceName]; + let rand = 0; + + for (let i = 0; i < 6; i += 1) { + rand += Math.random(); } - min = Math.ceil(min); - max = Math.floor(max); - return Math.floor(Math.random() * (max - min)) + min; + let randomValue = start + (rand / 6) * (end - start); + + if (randomValue < 0) randomValue = 0; + if (randomValue > 1) randomValue = 1; + + if (resourceName === RESOURCE_NAME.MEMORY_USAGE_BYTES) { + return parseInt(totalByte * randomValue); + } + return randomValue; }; + +module.exports = getRandomValue; diff --git a/metric/constants/common.js b/metric/constants/common.js new file mode 100644 index 0000000..214159e --- /dev/null +++ b/metric/constants/common.js @@ -0,0 +1,47 @@ +const INTERVAL_TIME = 15000; + +const NODE_TOTAL_BYTE = 17179869184; +const POD_TOTAL_BYTE = 2147483648; + +const RANGE_TYPE = { + NORMAL: 'normal', + OVERLOAD: 'overload', +}; + +const INSTANCE_TYPE = { + NODE: 'node', + POD: 'pod', +}; + +const RESOURCE_NAME = { + CPU_USAGE: 'cpuUsage', + MEMORY_USAGE: 'memoryUsage', + MEMORY_USAGE_BYTES: 'memoryUsageBytes', + DISK_LATENCY: 'diskLatency', +}; + +const METRIC_NAME = { + // node + CUSTOM_NODE_CPU_TOTAL: 'custom_node_cpu_total', + CUSTOM_NODE_CPU_USAGE: 'custom_node_cpu_usage', + CUSTOM_NODE_DISK_LATENCT: 'custom_node_disk_latency', + 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', + // 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', +}; + +module.exports = { + INTERVAL_TIME, + NODE_TOTAL_BYTE, + POD_TOTAL_BYTE, + RESOURCE_NAME, + INSTANCE_TYPE, + RANGE_TYPE, + METRIC_NAME, +}; diff --git a/metric/constants/range.js b/metric/constants/range.js new file mode 100644 index 0000000..29fe064 --- /dev/null +++ b/metric/constants/range.js @@ -0,0 +1,82 @@ +const { RANGE_TYPE, INSTANCE_TYPE, RESOURCE_NAME } = require('./common'); + +const RANGE = { + [RANGE_TYPE.NORMAL]: { + [INSTANCE_TYPE.NODE]: { + [RESOURCE_NAME.CPU_USAGE]: { + start: -0.25, + end: 0.75, + }, + [RESOURCE_NAME.MEMORY_USAGE]: { + start: 0, + end: 0.2, + }, + [RESOURCE_NAME.MEMORY_USAGE_BYTES]: { + start: 0, + end: 0.2, + }, + [RESOURCE_NAME.DISK_LATENCY]: { + start: -0.65, + end: 0.85, + }, + }, + [INSTANCE_TYPE.POD]: { + [RESOURCE_NAME.CPU_USAGE]: { + start: -0.1, + end: 0.9, + }, + [RESOURCE_NAME.MEMORY_USAGE]: { + start: 0, + end: 0.4, + }, + [RESOURCE_NAME.MEMORY_USAGE_BYTES]: { + start: 0, + end: 0.4, + }, + [RESOURCE_NAME.DISK_LATENCY]: { + start: 0.025, + end: 0.075, + }, + }, + }, + [RANGE_TYPE.OVERLOAD]: { + [INSTANCE_TYPE.NODE]: { + [RESOURCE_NAME.CPU_USAGE]: { + start: 0.5, + end: 0.95, + }, + [RESOURCE_NAME.MEMORY_USAGE]: { + start: 0.3, + end: 0.7, + }, + [RESOURCE_NAME.MEMORY_USAGE_BYTES]: { + start: 0.3, + end: 0.7, + }, + [RESOURCE_NAME.DISK_LATENCY]: { + start: -0.65, + end: 0.85, + }, + }, + [INSTANCE_TYPE.POD]: { + [RESOURCE_NAME.CPU_USAGE]: { + start: 0.5, + end: 1.1, + }, + [RESOURCE_NAME.MEMORY_USAGE]: { + start: 0.2, + end: 0.4, + }, + [RESOURCE_NAME.MEMORY_USAGE_BYTES]: { + start: 0.2, + end: 0.4, + }, + [RESOURCE_NAME.DISK_LATENCY]: { + start: 0.025, + end: 0.075, + }, + }, + }, +}; + +module.exports = RANGE; diff --git a/metric/node/customNodeCpuTotal.js b/metric/node/customNodeCpuTotal.js index ceebee6..70a2c40 100644 --- a/metric/node/customNodeCpuTotal.js +++ b/metric/node/customNodeCpuTotal.js @@ -1,21 +1,22 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const { INTERVAL_TIME, METRIC_NAME } = require('../constants/common'); const { NODE_LABEL_NAMES } = require('../constants/labelName'); const { nodes } = require('../constants/nodes'); const customNodeCpuTotal = (register) => { const metricConfig = getMetricConfig( - 'custom_node_cpu_total', + METRIC_NAME.CUSTOM_NODE_CPU_TOTAL, NODE_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); setInterval(() => { - nodes.forEach((pod) => { - g.set(pod, Math.random()); + nodes.forEach((node) => { + g.set(node, Math.random()); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/node/customNodeCpuUsage.js b/metric/node/customNodeCpuUsage.js index 4015505..a36d54b 100644 --- a/metric/node/customNodeCpuUsage.js +++ b/metric/node/customNodeCpuUsage.js @@ -1,21 +1,28 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); const { NODE_LABEL_NAMES } = require('../constants/labelName'); const { nodes } = require('../constants/nodes'); const customNodeCpuUsage = (register) => { const metricConfig = getMetricConfig( - 'custom_node_cpu_usage', + METRIC_NAME.CUSTOM_NODE_CPU_USAGE, NODE_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); setInterval(() => { - nodes.forEach((pod) => { - g.set(pod, Math.random()); + nodes.forEach((node) => { + g.set(node, getRandomValue(INSTANCE_TYPE.NODE, RESOURCE_NAME.CPU_USAGE)); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/node/customNodeDiskLatency.js b/metric/node/customNodeDiskLatency.js new file mode 100644 index 0000000..9294b0a --- /dev/null +++ b/metric/node/customNodeDiskLatency.js @@ -0,0 +1,33 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeDiskLatency = (register) => { + const metricConfig = getMetricConfig( + METRIC_NAME.CUSTOM_NODE_DISK_LATENCT, + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((node) => { + g.set( + node, + getRandomValue(INSTANCE_TYPE.NODE, RESOURCE_NAME.DISK_LATENCY) + ); + }); + }, INTERVAL_TIME); + + register.registerMetric(g); +}; + +module.exports = { customNodeDiskLatency }; diff --git a/metric/node/customNodeMemoryUsage.js b/metric/node/customNodeMemoryUsage.js new file mode 100644 index 0000000..56d82d1 --- /dev/null +++ b/metric/node/customNodeMemoryUsage.js @@ -0,0 +1,33 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeMemoryUsage = (register) => { + const metricConfig = getMetricConfig( + METRIC_NAME.CUSTOM_NODE_MEMORY_USAGE, + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((node) => { + g.set( + node, + getRandomValue(INSTANCE_TYPE.NODE, RESOURCE_NAME.MEMORY_USAGE) + ); + }); + }, INTERVAL_TIME); + + register.registerMetric(g); +}; + +module.exports = { customNodeMemoryUsage }; diff --git a/metric/node/customNodeMemoryUsageBytes.js b/metric/node/customNodeMemoryUsageBytes.js new file mode 100644 index 0000000..1e0fb0f --- /dev/null +++ b/metric/node/customNodeMemoryUsageBytes.js @@ -0,0 +1,33 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); +const { NODE_LABEL_NAMES } = require('../constants/labelName'); +const { nodes } = require('../constants/nodes'); + +const customNodeMemoryUsageBytes = (register) => { + const metricConfig = getMetricConfig( + METRIC_NAME.CUSTOM_NODE_MEMORY_USAGE_BYTES, + NODE_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + nodes.forEach((node) => { + g.set( + node, + getRandomValue(INSTANCE_TYPE.NODE, RESOURCE_NAME.MEMORY_USAGE_BYTES) + ); + }); + }, INTERVAL_TIME); + + register.registerMetric(g); +}; + +module.exports = { customNodeMemoryUsageBytes }; diff --git a/metric/node/customNodeTotalMemory.js b/metric/node/customNodeTotalMemory.js index 25c5d02..3ab674e 100644 --- a/metric/node/customNodeTotalMemory.js +++ b/metric/node/customNodeTotalMemory.js @@ -1,21 +1,22 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const { INTERVAL_TIME, METRIC_NAME } = require('../constants/common'); const { NODE_LABEL_NAMES } = require('../constants/labelName'); const { nodes } = require('../constants/nodes'); const customNodeTotalMemory = (register) => { const metricConfig = getMetricConfig( - 'custom_node_total_memory', + METRIC_NAME.CUSTOM_NODE_TOTAL_MEMORY, NODE_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); setInterval(() => { - nodes.forEach((pod) => { - g.set(pod, Math.random()); + nodes.forEach((node) => { + g.set(node, Math.random()); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/pod/customPodCpuUsage.js b/metric/pod/customPodCpuUsage.js index b091fd2..ef9cc72 100644 --- a/metric/pod/customPodCpuUsage.js +++ b/metric/pod/customPodCpuUsage.js @@ -1,18 +1,28 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); const { POD_LABEL_NAMES } = require('../constants/labelName'); const { pods } = require('../constants/pods'); const customPodCpuUsage = (register) => { - const metricConfig = getMetricConfig('custom_pod_cpu_usage', POD_LABEL_NAMES); + const metricConfig = getMetricConfig( + METRIC_NAME.CUSTOM_POD_CPU_USAGE, + POD_LABEL_NAMES + ); const g = new promClient.Gauge(metricConfig); setInterval(() => { pods.forEach((pod) => { - g.set(pod, Math.random()); + g.set(pod, getRandomValue(INSTANCE_TYPE.POD, RESOURCE_NAME.CPU_USAGE)); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/pod/customPodDiskLatency.js b/metric/pod/customPodDiskLatency.js new file mode 100644 index 0000000..baa8b2b --- /dev/null +++ b/metric/pod/customPodDiskLatency.js @@ -0,0 +1,30 @@ +const promClient = require('prom-client'); + +const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); +const { POD_LABEL_NAMES } = require('../constants/labelName'); +const { pods } = require('../constants/pods'); + +const customPodDiskLatency = (register) => { + const metricConfig = getMetricConfig( + METRIC_NAME.CUSTOM_POD_DISK_LATENCY, + POD_LABEL_NAMES + ); + const g = new promClient.Gauge(metricConfig); + + setInterval(() => { + pods.forEach((pod) => { + g.set(pod, getRandomValue(INSTANCE_TYPE.POD, RESOURCE_NAME.DISK_LATENCY)); + }); + }, INTERVAL_TIME); + + register.registerMetric(g); +}; + +module.exports = { customPodDiskLatency }; diff --git a/metric/pod/customPodMemoryUsage.js b/metric/pod/customPodMemoryUsage.js index 730b896..f90d9db 100644 --- a/metric/pod/customPodMemoryUsage.js +++ b/metric/pod/customPodMemoryUsage.js @@ -1,21 +1,28 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); const { POD_LABEL_NAMES } = require('../constants/labelName'); const { pods } = require('../constants/pods'); const customPodMemoryUsage = (register) => { const metricConfig = getMetricConfig( - 'custom_pod_memory_usage', + METRIC_NAME.CUSTOM_POD_MEMORY_USAGE, POD_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); setInterval(() => { pods.forEach((pod) => { - g.set(pod, Math.random()); + g.set(pod, getRandomValue(INSTANCE_TYPE.POD, RESOURCE_NAME.MEMORY_USAGE)); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/pod/customPodMemoryUsageBytes.js b/metric/pod/customPodMemoryUsageBytes.js index a3b025f..d123e2a 100644 --- a/metric/pod/customPodMemoryUsageBytes.js +++ b/metric/pod/customPodMemoryUsageBytes.js @@ -1,21 +1,31 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const getRandomValue = require('../common/randomValue'); +const { + INTERVAL_TIME, + METRIC_NAME, + INSTANCE_TYPE, + RESOURCE_NAME, +} = require('../constants/common'); const { POD_LABEL_NAMES } = require('../constants/labelName'); const { pods } = require('../constants/pods'); const customPodMemoryUsageBytes = (register) => { const metricConfig = getMetricConfig( - 'custom_pod_memory_usage_bytes', + METRIC_NAME.CUSTOM_POD_MEMORY_USAGE_BYTES, POD_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); setInterval(() => { pods.forEach((pod) => { - g.set(pod, parseInt(Math.random() * (Math.random() * 10000000))); + g.set( + pod, + getRandomValue(INSTANCE_TYPE.POD, RESOURCE_NAME.MEMORY_USAGE_BYTES) + ); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/metric/pod/customPodTotalMemory.js b/metric/pod/customPodTotalMemory.js index e64f5d0..253701d 100644 --- a/metric/pod/customPodTotalMemory.js +++ b/metric/pod/customPodTotalMemory.js @@ -1,12 +1,13 @@ const promClient = require('prom-client'); const getMetricConfig = require('../common/getMetricConfig'); +const { INTERVAL_TIME, METRIC_NAME } = require('../constants/common'); const { POD_LABEL_NAMES } = require('../constants/labelName'); const { pods } = require('../constants/pods'); const customPodTotalMemory = (register) => { const metricConfig = getMetricConfig( - 'custom_pod_total_memory', + METRIC_NAME.CUSTOM_POD_TOTAL_MEMORY, POD_LABEL_NAMES ); const g = new promClient.Gauge(metricConfig); @@ -15,7 +16,7 @@ const customPodTotalMemory = (register) => { pods.forEach((pod) => { g.set(pod, Math.random()); }); - }, 100); + }, INTERVAL_TIME); register.registerMetric(g); }; diff --git a/package-lock.json b/package-lock.json index 578f958..ce5c862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,15 @@ "license": "ISC", "dependencies": { "express": "^4.18.1", + "nodemon": "^2.0.19", "prom-client": "^14.0.1" } }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -25,11 +31,36 @@ "node": ">= 0.6" } }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, "node_modules/bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", @@ -58,6 +89,26 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -78,6 +129,37 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -202,6 +284,17 @@ "node": ">= 0.10.0" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/finalhandler": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", @@ -235,6 +328,19 @@ "node": ">= 0.6" } }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -253,6 +359,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -264,6 +381,14 @@ "node": ">= 0.4.0" } }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -301,6 +426,11 @@ "node": ">=0.10.0" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -314,6 +444,44 @@ "node": ">= 0.10" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -365,6 +533,17 @@ "node": ">= 0.6" } }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -378,6 +557,69 @@ "node": ">= 0.6" } }, + "node_modules/nodemon": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.19.tgz", + "integrity": "sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A==", + "hasInstallScript": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", @@ -410,6 +652,17 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/prom-client": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz", @@ -433,6 +686,11 @@ "node": ">= 0.10" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "node_modules/qs": { "version": "6.10.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", @@ -469,6 +727,17 @@ "node": ">= 0.8" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -493,6 +762,14 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -553,6 +830,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -561,6 +857,17 @@ "node": ">= 0.8" } }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/tdigest": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", @@ -569,6 +876,17 @@ "bintrees": "1.0.2" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -577,6 +895,17 @@ "node": ">=0.6" } }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -589,6 +918,11 @@ "node": ">= 0.6" } }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -615,6 +949,11 @@ } }, "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -624,11 +963,30 @@ "negotiator": "0.6.3" } }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + }, "bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", @@ -653,6 +1011,23 @@ "unpipe": "1.0.0" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -667,6 +1042,26 @@ "get-intrinsic": "^1.0.2" } }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -766,6 +1161,14 @@ "vary": "~1.1.2" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, "finalhandler": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", @@ -790,6 +1193,12 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -805,6 +1214,14 @@ "has-symbols": "^1.0.3" } }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -813,6 +1230,11 @@ "function-bind": "^1.1.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -838,6 +1260,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -848,6 +1275,32 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -881,6 +1334,14 @@ "mime-db": "1.52.0" } }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -891,6 +1352,51 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "nodemon": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.19.tgz", + "integrity": "sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A==", + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, "object-inspect": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", @@ -914,6 +1420,11 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, "prom-client": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz", @@ -931,6 +1442,11 @@ "ipaddr.js": "1.9.1" } }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, "qs": { "version": "6.10.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", @@ -955,6 +1471,14 @@ "unpipe": "1.0.0" } }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -965,6 +1489,11 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, "send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -1018,11 +1547,34 @@ "object-inspect": "^1.9.0" } }, + "simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==" + } + } + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "tdigest": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", @@ -1031,11 +1583,27 @@ "bintrees": "1.0.2" } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "requires": { + "nopt": "~1.0.10" + } + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1045,6 +1613,11 @@ "mime-types": "~2.1.24" } }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index 86770f4..0410563 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "main": "index.js", "scripts": { + "dev": "nodemon index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], @@ -11,6 +12,7 @@ "license": "ISC", "dependencies": { "express": "^4.18.1", + "nodemon": "^2.0.19", "prom-client": "^14.0.1" } } From aaa04cf86cab76a99d6f28d6adac8565c695f6b8 Mon Sep 17 00:00:00 2001 From: lsh Date: Sun, 24 Jul 2022 18:25:38 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Feat:=20pod=20=EC=86=8D=EC=84=B1=EA=B0=92?= =?UTF-8?q?=20deployment=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metric/constants/pods.js | 61 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/metric/constants/pods.js b/metric/constants/pods.js index 876ead9..71a010b 100644 --- a/metric/constants/pods.js +++ b/metric/constants/pods.js @@ -1,296 +1,351 @@ const pods = [ - // seoul { namespace: 'zandi-backend', pod: 'swagger-deployment-1771418926-7o5ns', instance: 'seouln01', + deployment: 'swagger-deployment-1771418926', }, { namespace: 'zandi-backend', pod: 'swagger-deployment-1771418926-r18ao', instance: 'seouln03', + deployment: 'swagger-deployment-1771418926', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-38d2a', instance: 'seouln05', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-2dzos', instance: 'seouln02', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-29dcs', instance: 'seouln04', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-9jdsi', instance: 'seouln01', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'mariadb-deployment-2913201382-9sjwa', instance: 'seouln02', + deployment: 'mariadb-deployment-2913201382', }, { namespace: 'zandi-backend', pod: 'mariadb-deployment-2913201382-2sadw', instance: 'seouln03', + deployment: 'mariadb-deployment-2913201382', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-9dxw2', instance: 'seouln05', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-23jfd', instance: 'seouln05', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-e29aw', instance: 'seouln03', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-5djwu', instance: 'seouln01', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-d392a', instance: 'seouln05', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-93fhs', instance: 'seouln01', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-8dhwu', instance: 'seouln04', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-i28e3', instance: 'seouln05', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-d48da', instance: 'seouln03', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-8saiw', instance: 'seouln01', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-9dwja', instance: 'seouln02', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-blue-deployment-3291203292-0ad92', instance: 'seouln01', + deployment: 'uncloudy-grapher-blue-deployment-3291203292', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-blue-deployment-3291203292-8sjaw', instance: 'seouln04', + deployment: 'uncloudy-grapher-blue-deployment-3291203292', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-green-deployment-7253917392-38udh', instance: 'seouln03', + deployment: 'uncloudy-grapher-green-deployment-7253917392', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-green-deployment-7253917392-d82hw', instance: 'seouln04', + deployment: 'uncloudy-grapher-green-deployment-7253917392', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-9dwqa', instance: 'seouln04', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-vcus1', instance: 'seouln03', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-dehy2', instance: 'seouln02', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'prometheus-deployment-8347123928-d9a8w', instance: 'seouln02', + deployment: 'prometheus-deployment-8347123928', }, { namespace: 'infra', pod: 'prometheus-deployment-8347123928-vn28a', instance: 'seouln04', + deployment: 'prometheus-deployment-8347123928', }, { namespace: 'infra', pod: 'grafana-deployment-5738192321-9sj2a', instance: 'seouln01', + deployment: 'grafana-deployment-5738192321', }, - - // busan { namespace: 'zandi-backend', pod: 'swagger-deployment-1771418926-7o5ns', instance: 'busann01', + deployment: 'swagger-deployment-1771418926', }, { namespace: 'zandi-backend', pod: 'swagger-deployment-1771418926-r18ao', instance: 'busann05', + deployment: 'swagger-deployment-1771418926', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-38d2a', instance: 'busann01', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-2dzos', instance: 'busann03', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-29dcs', instance: 'busann02', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'nodejs-deployment-2231392811-9jdsi', instance: 'busann05', + deployment: 'nodejs-deployment-2231392811', }, { namespace: 'zandi-backend', pod: 'mariadb-deployment-2913201382-9sjwa', instance: 'busann03', + deployment: 'mariadb-deployment-2913201382', }, { namespace: 'zandi-backend', pod: 'mariadb-deployment-2913201382-2sadw', instance: 'busann02', + deployment: 'mariadb-deployment-2913201382', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-9dxw2', instance: 'busann05', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-23jfd', instance: 'busann01', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-e29aw', instance: 'busann04', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'zandi-frontend', pod: 'zandi-grapher-deployment-9442134208-5djwu', instance: 'busann05', + deployment: 'zandi-grapher-deployment-9442134208', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-d392a', instance: 'busann04', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-93fhs', instance: 'busann01', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-8dhwu', instance: 'busann04', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'nodejs-deployment-3942392102-i28e3', instance: 'busann01', + deployment: 'nodejs-deployment-3942392102', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-d48da', instance: 'busann02', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-8saiw', instance: 'busann02', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-backend', pod: 'mysql-deployment-7532913428-9dwja', instance: 'busann03', + deployment: 'mysql-deployment-7532913428', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-blue-deployment-3291203292-0ad92', instance: 'busann03', + deployment: 'uncloudy-grapher-blue-deployment-3291203292', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-blue-deployment-3291203292-8sjaw', instance: 'busann05', + deployment: 'uncloudy-grapher-blue-deployment-3291203292', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-green-deployment-7253917392-38udh', instance: 'busann02', + deployment: 'uncloudy-grapher-green-deployment-7253917392', }, { namespace: 'uncloudy-frontend', pod: 'uncloudy-grapher-green-deployment-7253917392-d82hw', instance: 'busann05', + deployment: 'uncloudy-grapher-green-deployment-7253917392', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-9dwqa', instance: 'busann04', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-vcus1', instance: 'busann04', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'monitoring-agent-deployment-8573293182-dehy2', instance: 'busann05', + deployment: 'monitoring-agent-deployment-8573293182', }, { namespace: 'infra', pod: 'prometheus-deployment-8347123928-d9a8w', instance: 'busann01', + deployment: 'prometheus-deployment-8347123928', }, { namespace: 'infra', pod: 'prometheus-deployment-8347123928-vn28a', instance: 'busann03', + deployment: 'prometheus-deployment-8347123928', }, { namespace: 'infra', pod: 'grafana-deployment-5738192321-9sj2a', instance: 'busann02', + deployment: 'grafana-deployment-5738192321', }, ]; From 6a2d33a88a44f218eb368e6cb8ac398c6d326a9f Mon Sep 17 00:00:00 2001 From: lsh Date: Sun, 24 Jul 2022 18:27:31 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Feat:=20pod=20label=20name=20deployment=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metric/constants/labelName.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metric/constants/labelName.js b/metric/constants/labelName.js index 7e1154a..9d63098 100644 --- a/metric/constants/labelName.js +++ b/metric/constants/labelName.js @@ -1,4 +1,4 @@ -const POD_LABEL_NAMES = ['pod', 'namespace', 'instance']; +const POD_LABEL_NAMES = ['pod', 'namespace', 'instance', 'deployment']; const NODE_LABEL_NAMES = ['container', 'cluster', 'instance']; module.exports = { From 5e916e8571aa503a9247c7e7b10e890e94a208a9 Mon Sep 17 00:00:00 2001 From: lsh Date: Fri, 29 Jul 2022 18:09:27 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Feat:=20swagger=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 5 + package-lock.json | 476 ++++++++++++++++++++++++++++++++++++++++++- package.json | 4 +- swagger/swagger.json | 219 ++++++++++++++++++++ 4 files changed, 702 insertions(+), 2 deletions(-) create mode 100644 swagger/swagger.json diff --git a/index.js b/index.js index 5ad430a..564b5f9 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,8 @@ const client = require('prom-client'); const express = require('express'); +const swaggerUi = require('swagger-ui-express'); + +const spec = require('./swagger/swagger.json'); const { customPodCpuUsage } = require('./metric/pod/customPodCpuUsage'); const { customPodMemoryUsage } = require('./metric/pod/customPodMemoryUsage'); @@ -46,6 +49,8 @@ customNodeMemoryUsage(register); customNodeMemoryUsageBytes(register); customNodeTotalMemory(register); +app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(spec)); + app.get('/metrics', async (req, res) => { res.setHeader('Content-Type', register.contentType); res.send(await register.metrics()); diff --git a/package-lock.json b/package-lock.json index ce5c862..992d86c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,61 @@ "dependencies": { "express": "^4.18.1", "nodemon": "^2.0.19", - "prom-client": "^14.0.1" + "prom-client": "^14.0.1", + "swagger-jsdoc": "^6.2.1", + "swagger-ui-express": "^4.5.0" } }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, + "node_modules/@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==" + }, + "node_modules/@apidevtools/swagger-parser": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.2.tgz", + "integrity": "sha512-JFxcEyp8RlNHgBCE98nwuTkZT6eNFPc1aosWV6wPcQph72TSEEu1k3baJD4/x1qznU+JiDdz8F5pTwabZh+Dhg==", + "dependencies": { + "@apidevtools/json-schema-ref-parser": "^9.0.6", + "@apidevtools/openapi-schemas": "^2.0.4", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "z-schema": "^4.2.3" + }, + "peerDependencies": { + "openapi-types": ">=7" + } + }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -43,6 +95,11 @@ "node": ">= 8" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -129,6 +186,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==" + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -155,6 +217,14 @@ "fsevents": "~2.3.2" } }, + "node_modules/commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "engines": { + "node": ">= 6" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -217,6 +287,17 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -235,6 +316,14 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -328,6 +417,11 @@ "node": ">= 0.6" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -359,6 +453,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -431,6 +544,15 @@ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -482,6 +604,32 @@ "node": ">=0.12.0" } }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -639,6 +787,20 @@ "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/openapi-types": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.0.0.tgz", + "integrity": "sha512-6Wd9k8nmGQHgCbehZCP6wwWcfXcvinhybUTBatuhjRsCxUIujuYFZc9QnGeae75CyHASewBtxs0HX/qwREReUw==", + "peer": true + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -647,6 +809,14 @@ "node": ">= 0.8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -868,6 +1038,55 @@ "node": ">=4" } }, + "node_modules/swagger-jsdoc": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/swagger-jsdoc/-/swagger-jsdoc-6.2.1.tgz", + "integrity": "sha512-l2BwFf7wzNPb11+NRRy65X+kuHUGLb3ZuGFn6A8xDXXTu73YzJmCiy+LED/6QsOgPBPgO3u3sDEz6KuOHAlCtA==", + "dependencies": { + "commander": "6.2.0", + "doctrine": "3.0.0", + "glob": "7.1.6", + "lodash.mergewith": "^4.6.2", + "swagger-parser": "10.0.2", + "yaml": "2.0.0-1" + }, + "bin": { + "swagger-jsdoc": "bin/swagger-jsdoc.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/swagger-parser": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.2.tgz", + "integrity": "sha512-9jHkHM+QXyLGFLk1DkXBwV+4HyNm0Za3b8/zk/+mjr8jgOSiqm3FOTHBSDsBjtn9scdL+8eWcHdupp2NLM8tDw==", + "dependencies": { + "@apidevtools/swagger-parser": "10.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/swagger-ui-dist": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.13.0.tgz", + "integrity": "sha512-5yqhkUU9uV5oT/MTMBeSgDGI0Vx6eCOU43AszQBs88poI8OB1v+FoXEFHv+NaBbEfTkXCMWlAJrH6iWyDzLETQ==" + }, + "node_modules/swagger-ui-express": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-4.5.0.tgz", + "integrity": "sha512-DHk3zFvsxrkcnurGvQlAcLuTDacAVN1JHKDgcba/gr2NFRE4HGwP1YeHIXMiGznkWR4AeS7X5vEblNn4QljuNA==", + "dependencies": { + "swagger-ui-dist": ">=4.11.0" + }, + "engines": { + "node": ">= v0.10.32" + }, + "peerDependencies": { + "express": ">=4.0.0" + } + }, "node_modules/tdigest": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", @@ -939,6 +1158,14 @@ "node": ">= 0.4.0" } }, + "node_modules/validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -946,9 +1173,91 @@ "engines": { "node": ">= 0.8" } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yaml": { + "version": "2.0.0-1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.0.0-1.tgz", + "integrity": "sha512-W7h5dEhywMKenDJh2iX/LABkbFnBxasD27oyXWDS/feDsxiw0dD5ncXdYXgkvAsXIY2MpW/ZKkr9IU30DBdMNQ==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/z-schema": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-4.2.4.tgz", + "integrity": "sha512-YvBeW5RGNeNzKOUJs3rTL4+9rpcvHXt5I051FJbOcitV8bl40pEfcG0Q+dWSwS0/BIYrMZ/9HHoqLllMkFhD0w==", + "dependencies": { + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.6.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "engines": { + "node": ">=6.0.0" + }, + "optionalDependencies": { + "commander": "^2.7.1" + } + }, + "node_modules/z-schema/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "optional": true } }, "dependencies": { + "@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "requires": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, + "@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==" + }, + "@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==" + }, + "@apidevtools/swagger-parser": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.2.tgz", + "integrity": "sha512-JFxcEyp8RlNHgBCE98nwuTkZT6eNFPc1aosWV6wPcQph72TSEEu1k3baJD4/x1qznU+JiDdz8F5pTwabZh+Dhg==", + "requires": { + "@apidevtools/json-schema-ref-parser": "^9.0.6", + "@apidevtools/openapi-schemas": "^2.0.4", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "z-schema": "^4.2.3" + } + }, + "@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" + }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -972,6 +1281,11 @@ "picomatch": "^2.0.4" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -1042,6 +1356,11 @@ "get-intrinsic": "^1.0.2" } }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==" + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -1057,6 +1376,11 @@ "readdirp": "~3.6.0" } }, + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1103,6 +1427,14 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -1118,6 +1450,11 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -1193,6 +1530,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -1214,6 +1556,19 @@ "has-symbols": "^1.0.3" } }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1265,6 +1620,15 @@ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1301,6 +1665,29 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1410,11 +1797,30 @@ "ee-first": "1.1.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "openapi-types": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.0.0.tgz", + "integrity": "sha512-6Wd9k8nmGQHgCbehZCP6wwWcfXcvinhybUTBatuhjRsCxUIujuYFZc9QnGeae75CyHASewBtxs0HX/qwREReUw==", + "peer": true + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -1575,6 +1981,40 @@ "has-flag": "^3.0.0" } }, + "swagger-jsdoc": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/swagger-jsdoc/-/swagger-jsdoc-6.2.1.tgz", + "integrity": "sha512-l2BwFf7wzNPb11+NRRy65X+kuHUGLb3ZuGFn6A8xDXXTu73YzJmCiy+LED/6QsOgPBPgO3u3sDEz6KuOHAlCtA==", + "requires": { + "commander": "6.2.0", + "doctrine": "3.0.0", + "glob": "7.1.6", + "lodash.mergewith": "^4.6.2", + "swagger-parser": "10.0.2", + "yaml": "2.0.0-1" + } + }, + "swagger-parser": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.2.tgz", + "integrity": "sha512-9jHkHM+QXyLGFLk1DkXBwV+4HyNm0Za3b8/zk/+mjr8jgOSiqm3FOTHBSDsBjtn9scdL+8eWcHdupp2NLM8tDw==", + "requires": { + "@apidevtools/swagger-parser": "10.0.2" + } + }, + "swagger-ui-dist": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.13.0.tgz", + "integrity": "sha512-5yqhkUU9uV5oT/MTMBeSgDGI0Vx6eCOU43AszQBs88poI8OB1v+FoXEFHv+NaBbEfTkXCMWlAJrH6iWyDzLETQ==" + }, + "swagger-ui-express": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-4.5.0.tgz", + "integrity": "sha512-DHk3zFvsxrkcnurGvQlAcLuTDacAVN1JHKDgcba/gr2NFRE4HGwP1YeHIXMiGznkWR4AeS7X5vEblNn4QljuNA==", + "requires": { + "swagger-ui-dist": ">=4.11.0" + } + }, "tdigest": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", @@ -1628,10 +2068,44 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, + "validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "yaml": { + "version": "2.0.0-1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.0.0-1.tgz", + "integrity": "sha512-W7h5dEhywMKenDJh2iX/LABkbFnBxasD27oyXWDS/feDsxiw0dD5ncXdYXgkvAsXIY2MpW/ZKkr9IU30DBdMNQ==" + }, + "z-schema": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-4.2.4.tgz", + "integrity": "sha512-YvBeW5RGNeNzKOUJs3rTL4+9rpcvHXt5I051FJbOcitV8bl40pEfcG0Q+dWSwS0/BIYrMZ/9HHoqLllMkFhD0w==", + "requires": { + "commander": "^2.7.1", + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.6.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "optional": true + } + } } } } diff --git a/package.json b/package.json index 0410563..58b0392 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "dependencies": { "express": "^4.18.1", "nodemon": "^2.0.19", - "prom-client": "^14.0.1" + "prom-client": "^14.0.1", + "swagger-jsdoc": "^6.2.1", + "swagger-ui-express": "^4.5.0" } } diff --git a/swagger/swagger.json b/swagger/swagger.json new file mode 100644 index 0000000..d80c6bc --- /dev/null +++ b/swagger/swagger.json @@ -0,0 +1,219 @@ +{ + "swagger": "2.0.0", + "info": { + "version": "0.1.0", + "title": "prometheus-metrics", + "description": "uncloudy-grapher를 위한 prometheus-metrics 입니다.", + "license": { + "name": "MIT", + "url": "http://localhost:9090/api/v1" + } + }, + "host": "localhost:9090/api/v1", + "schemes": ["http"], + "paths": { + "/query?query={query}&time={time}": { + "get": { + "tags": ["prometheus-metric"], + "summary": "resultType: vector", + "parameters": [ + { + "name": "query", + "in": "path", + "required": true, + "type": "string", + "format": "string", + "example": "custom_node_cpu_total" + }, + { + "name": "time", + "in": "path", + "required": true, + "type": "string", + "format": "dateTime", + "example": 1659083667.513 + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#definitions/vector" + } + } + } + } + }, + "/query?query={query}{timeRange}&time={time}": { + "get": { + "tags": ["prometheus-metric"], + "summary": "resultType: vector", + "parameters": [ + { + "name": "query", + "in": "path", + "required": true, + "type": "string", + "example": "custom_node_cpu_total" + }, + { + "name": "timeRange", + "in": "path", + "required": true, + "type": "string", + "example": "[1m]" + }, + { + "name": "time", + "in": "path", + "required": true, + "type": "string", + "example": 1659083667.513 + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#definitions/matrix" + } + } + } + } + } + }, + "definitions": { + "vector": { + "properties": { + "status": { + "type": "integer", + "example": "success" + }, + "data": { + "properties": { + "resultType": { + "type": "string", + "example": "vector" + }, + "result": { + "type": "array", + "items": { + "properties": { + "metric": { + "properties": { + "__name__": { + "type": "string", + "example": "custom_node_cpu_total" + }, + "cluster": { + "type": "string", + "example": "busan" + }, + "container": { + "type": "string", + "example": "nodejs" + }, + "instance": { + "type": "string", + "example": "busanh02" + }, + "job": { + "type": "string", + "example": "kube_state_demo" + } + } + }, + "value": { + "type": "array", + "example": [1659074738.418, "0.2925363504199614"] + } + } + } + } + } + } + } + }, + "matrix": { + "properties": { + "status": { + "type": "integer", + "example": "success" + }, + "data": { + "properties": { + "resultType": { + "type": "string", + "example": "matrix" + }, + "result": { + "type": "array", + "items": { + "properties": { + "metric": { + "properties": { + "__name__": { + "type": "string", + "example": "custom_node_cpu_total" + }, + "cluster": { + "type": "string", + "example": "busan" + }, + "container": { + "type": "string", + "example": "nodejs" + }, + "instance": { + "type": "string", + "example": "busanh02" + }, + "job": { + "type": "string", + "example": "kube_state_demo" + } + } + }, + "values": { + "type": "array", + "example": [ + [1659083667.513, "0.9572312074314"], + [1659083712.513, "0.2589979277102208"] + ] + } + } + } + } + } + } + } + }, + "value": { + "properties": { + "0": { + "type": "float", + "description": "metric 수집 시각" + }, + "1": { + "type": "string", + "description": "metric value" + } + } + }, + "values": { + "type": "array", + "items": { + "properties": { + "0": { + "type": "float", + "description": "metric 수집 시각" + }, + "1": { + "type": "string", + "description": "metric value" + } + } + } + } + } +} From f5aaa0953770ddf6e1074a0d81ab380e2072e092 Mon Sep 17 00:00:00 2001 From: lsh Date: Sat, 6 Aug 2022 19:58:13 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Feat:=20swagger=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- swagger/swagger.json | 206 +++++++++++++++++++++++++++++++++---------- 1 file changed, 159 insertions(+), 47 deletions(-) diff --git a/swagger/swagger.json b/swagger/swagger.json index d80c6bc..5e16921 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -6,76 +6,59 @@ "description": "uncloudy-grapher를 위한 prometheus-metrics 입니다.", "license": { "name": "MIT", - "url": "http://localhost:9090/api/v1" + "url": "http://uncloudy.duckdns.org:9090/api/v1" } }, - "host": "localhost:9090/api/v1", + "host": "uncloudy.duckdns.org:9090/api/v1", "schemes": ["http"], "paths": { "/query?query={query}&time={time}": { "get": { "tags": ["prometheus-metric"], - "summary": "resultType: vector", + "summary": "custom_node_cpu_usage", "parameters": [ { "name": "query", "in": "path", "required": true, "type": "string", - "format": "string", - "example": "custom_node_cpu_total" + "default": "custom_node_cpu_usage[1m]", + "example": "custom_node_cpu_usage[1m]", + "description": "prom-ql" }, { "name": "time", "in": "path", "required": true, "type": "string", - "format": "dateTime", - "example": 1659083667.513 + "example": 1659782551.14, + "default": 1659782551.14, + "description": "기준 시각" } ], "responses": { - "200": { - "description": "OK", + "200: node vector": { + "description": "node metric의 value가 1개일 경우", "schema": { - "$ref": "#definitions/vector" + "$ref": "#definitions/node_vector" } - } - } - } - }, - "/query?query={query}{timeRange}&time={time}": { - "get": { - "tags": ["prometheus-metric"], - "summary": "resultType: vector", - "parameters": [ - { - "name": "query", - "in": "path", - "required": true, - "type": "string", - "example": "custom_node_cpu_total" }, - { - "name": "timeRange", - "in": "path", - "required": true, - "type": "string", - "example": "[1m]" + "200: node metric": { + "description": "node metric의 value가 여러개일 경우", + "schema": { + "$ref": "#definitions/node_matrix" + } }, - { - "name": "time", - "in": "path", - "required": true, - "type": "string", - "example": 1659083667.513 - } - ], - "responses": { - "200": { - "description": "OK", + "200: pod vector": { + "description": "pod metric의 value가 1개일 경우", "schema": { - "$ref": "#definitions/matrix" + "$ref": "#definitions/pod_vector" + } + }, + "200: pod metric": { + "description": "pod metric의 value가 여러개일 경우", + "schema": { + "$ref": "#definitions/pod_matrix" } } } @@ -83,7 +66,7 @@ } }, "definitions": { - "vector": { + "node_vector": { "properties": { "status": { "type": "integer", @@ -103,7 +86,7 @@ "properties": { "__name__": { "type": "string", - "example": "custom_node_cpu_total" + "example": "query resource" }, "cluster": { "type": "string", @@ -120,6 +103,10 @@ "job": { "type": "string", "example": "kube_state_demo" + }, + "os": { + "type": "string", + "example": "ubuntu" } } }, @@ -134,7 +121,7 @@ } } }, - "matrix": { + "node_matrix": { "properties": { "status": { "type": "integer", @@ -154,7 +141,7 @@ "properties": { "__name__": { "type": "string", - "example": "custom_node_cpu_total" + "example": "query resource" }, "cluster": { "type": "string", @@ -171,6 +158,131 @@ "job": { "type": "string", "example": "kube_state_demo" + }, + "os": { + "type": "string", + "example": "ubuntu" + } + } + }, + "values": { + "type": "array", + "example": [ + [1659083667.513, "0.9572312074314"], + [1659083712.513, "0.2589979277102208"] + ] + } + } + } + } + } + } + } + }, + "pod_vector": { + "properties": { + "status": { + "type": "integer", + "example": "success" + }, + "data": { + "properties": { + "resultType": { + "type": "string", + "example": "vector" + }, + "result": { + "type": "array", + "items": { + "properties": { + "metric": { + "properties": { + "__name__": { + "type": "string", + "example": "query resource" + }, + "deployment": { + "type": "string", + "example": "grafana-deployment-5738192321" + }, + "instance": { + "type": "string", + "example": "busanh02" + }, + "job": { + "type": "string", + "example": "kube_state_demo" + }, + "namespace": { + "type": "string", + "example": "infra" + }, + "pod": { + "type": "string", + "example": "grafana-deployment-5738192321-9sj2a" + }, + "os": { + "type": "string", + "example": "ubuntu" + } + } + }, + "value": { + "type": "array", + "example": [1659074738.418, "0.2925363504199614"] + } + } + } + } + } + } + } + }, + "pod_matrix": { + "properties": { + "status": { + "type": "integer", + "example": "success" + }, + "data": { + "properties": { + "resultType": { + "type": "string", + "example": "matrix" + }, + "result": { + "type": "array", + "items": { + "properties": { + "metric": { + "properties": { + "__name__": { + "type": "string", + "example": "query resource" + }, + "deployment": { + "type": "string", + "example": "grafana-deployment-5738192321" + }, + "instance": { + "type": "string", + "example": "busanh02" + }, + "job": { + "type": "string", + "example": "kube_state_demo" + }, + "namespace": { + "type": "string", + "example": "infra" + }, + "pod": { + "type": "string", + "example": "grafana-deployment-5738192321-9sj2a" + }, + "os": { + "type": "string", + "example": "ubuntu" } } },