Date: Wed, 6 Dec 2023 20:12:04 +0800
Subject: [PATCH 024/176] feat(web.appobservable): Appobservable support add
new page by config
---
sysom_web/config/routes.js | 56 ++++----
.../resource/app_observable/v1/locales.json | 27 ++++
.../resource/app_observable/v1/mysql.json | 16 +++
.../resource/app_observable/v1/nginx.json | 16 +++
.../resource/app_observable/v1/ntopo.json | 9 ++
.../app_observable/v1/process_app.json | 9 ++
sysom_web/src/app.jsx | 33 ++++-
sysom_web/src/locales/en-US/menu.js | 11 +-
sysom_web/src/locales/zh-CN/menu.js | 12 +-
.../components/multiGrafanaPannel.js | 41 ++++--
.../components/singleGrafanaPannel.js | 39 +++++
sysom_web/src/pages/app_observable/index.js | 42 ++++++
.../src/pages/app_observable/mysql/index.js | 136 +++---------------
13 files changed, 280 insertions(+), 167 deletions(-)
create mode 100644 sysom_web/public/resource/app_observable/v1/locales.json
create mode 100644 sysom_web/public/resource/app_observable/v1/mysql.json
create mode 100644 sysom_web/public/resource/app_observable/v1/nginx.json
create mode 100644 sysom_web/public/resource/app_observable/v1/ntopo.json
create mode 100644 sysom_web/public/resource/app_observable/v1/process_app.json
create mode 100644 sysom_web/src/pages/app_observable/components/singleGrafanaPannel.js
create mode 100644 sysom_web/src/pages/app_observable/index.js
diff --git a/sysom_web/config/routes.js b/sysom_web/config/routes.js
index 141554d1..d8a335f9 100644
--- a/sysom_web/config/routes.js
+++ b/sysom_web/config/routes.js
@@ -157,34 +157,34 @@ export default [
name: 'app_observable',
access: 'canAdmin',
routes: [
- {
- path: '/app_observable',
- redirect: "/app_observable/net_topo",
- },
- {
- path: '/app_observable/net_topo',
- name: 'net_topo',
- component: "./app_observable/net_topo"
- },
- {
- path: '/app_observable/mysql',
- name: 'mysql',
- component: "./app_observable/mysql"
- },
- {
- path: "/app_observable/java",
- redirect: '/app_observable/process',
- },
- {
- path: "/app_observable/process",
- name: "process",
- component: "./app_observable/process"
- },
- {
- path: "/app_observable/nginx",
- name: "nginx",
- component: "./app_observable/nginx"
- }
+ // {
+ // path: '/app_observable',
+ // redirect: "/app_observable/net_topo",
+ // },
+ // {
+ // path: '/app_observable/net_topo',
+ // name: 'net_topo',
+ // component: "./app_observable/net_topo"
+ // },
+ // {
+ // path: '/app_observable/mysql',
+ // name: 'mysql',
+ // component: "./app_observable/mysql"
+ // },
+ // {
+ // path: "/app_observable/java",
+ // redirect: '/app_observable/process',
+ // },
+ // {
+ // path: "/app_observable/process",
+ // name: "process",
+ // component: "./app_observable/process"
+ // },
+ // {
+ // path: "/app_observable/nginx",
+ // name: "nginx",
+ // component: "./app_observable/nginx"
+ // }
],
},
{
diff --git a/sysom_web/public/resource/app_observable/v1/locales.json b/sysom_web/public/resource/app_observable/v1/locales.json
new file mode 100644
index 00000000..61264843
--- /dev/null
+++ b/sysom_web/public/resource/app_observable/v1/locales.json
@@ -0,0 +1,27 @@
+{
+ "version": 1.0,
+ "menus": [
+ "menu.app_observable.ntopo",
+ "menu.app_observable.mysql",
+ "menu.app_observable.nginx",
+ "menu.app_observable.process_app"
+ ],
+ "locales": {
+ "zh-CN": {
+ "menu.app_observable.mysql": "MySQL应用观测",
+ "menu.app_observable.nginx": "Nginx应用观测",
+ "menu.app_observable.ntopo": "网络拓扑",
+ "menu.app_observable.process_app": "进程可观测",
+ "pages.app_observable.monitor_dashboard": "监控面板",
+ "pages.app_observable.abnormal_events": "异常事件"
+ },
+ "en-US": {
+ "menu.app_observable.ntopo": "Network Topology",
+ "menu.app_observable.mysql": "MySQL Observability",
+ "menu.app_observable.nginx": "Nginx Observability",
+ "menu.app_observable.process_app": "Process Observability",
+ "pages.app_observable.monitor_dashboard": "Monitor Dashboard",
+ "pages.app_observable.abnormal_events": "Abnormal Events"
+ }
+ }
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/app_observable/v1/mysql.json b/sysom_web/public/resource/app_observable/v1/mysql.json
new file mode 100644
index 00000000..4ae4d13d
--- /dev/null
+++ b/sysom_web/public/resource/app_observable/v1/mysql.json
@@ -0,0 +1,16 @@
+{
+ "menuName": "menu.app_observable.mysql",
+ "type": "multiGrafanaPannel",
+ "config": [
+ {
+ "pannelId": "mysql_monitor",
+ "pannelName": "pages.app_observable.monitor_dashboard",
+ "pannelUrl": "/grafana/d/hOk70b34k/app-mysql"
+ },
+ {
+ "pannelId": "mysql_event",
+ "pannelName": "pages.app_observable.abnormal_events",
+ "pannelUrl": "/grafana/d/Ub__1x3Vz/app-mysql-events"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/app_observable/v1/nginx.json b/sysom_web/public/resource/app_observable/v1/nginx.json
new file mode 100644
index 00000000..8a2c4e20
--- /dev/null
+++ b/sysom_web/public/resource/app_observable/v1/nginx.json
@@ -0,0 +1,16 @@
+{
+ "menuName": "menu.app_observable.nginx",
+ "type": "multiGrafanaPannel",
+ "config": [
+ {
+ "pannelId": "nginx_monitor",
+ "pannelName": "pages.app_observable.monitor_dashboard",
+ "pannelUrl": "/grafana/d/6Mztrm4Ik/nginx"
+ },
+ {
+ "pannelId": "nginx_event",
+ "pannelName": "pages.app_observable.abnormal_events",
+ "pannelUrl": "/grafana/d/HtuWUeSSz/nginx-event"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/app_observable/v1/ntopo.json b/sysom_web/public/resource/app_observable/v1/ntopo.json
new file mode 100644
index 00000000..a3271584
--- /dev/null
+++ b/sysom_web/public/resource/app_observable/v1/ntopo.json
@@ -0,0 +1,9 @@
+{
+ "menuName": "menu.app_observable.ntopo",
+ "type": "singleGrafanaPannel",
+ "config": {
+ "pannelId": "ntopo",
+ "pannelName": "",
+ "pannelUrl": "/grafana/d/H04tHN34k/ntopo"
+ }
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/app_observable/v1/process_app.json b/sysom_web/public/resource/app_observable/v1/process_app.json
new file mode 100644
index 00000000..c9fd3815
--- /dev/null
+++ b/sysom_web/public/resource/app_observable/v1/process_app.json
@@ -0,0 +1,9 @@
+{
+ "menuName": "menu.app_observable.process_app",
+ "type": "singleGrafanaPannel",
+ "config": {
+ "pannelId": "process_app",
+ "pannelName": "",
+ "pannelUrl": "/grafana/d/FP_k0bqVz/process_app"
+ }
+}
\ No newline at end of file
diff --git a/sysom_web/src/app.jsx b/sysom_web/src/app.jsx
index 48e96b41..861a1ced 100644
--- a/sysom_web/src/app.jsx
+++ b/sysom_web/src/app.jsx
@@ -108,6 +108,7 @@ export const layout = ({ initialState }) => {
let extraGrafanaRoutes = [];
let extraDiagnoseRoute = [];
+let extraAppObserverRoute = [];
// Saved menu_name -> service_name
// @see menuName => config/routes.js
// @see servierName => /api/v1/services/list
@@ -184,11 +185,16 @@ export function patchRoutes({ routes }) {
rootPath.routes.find((item) => item.name == "monitor")
.routes.splice(-1, 0, ...extraGrafanaRoutes)
- // //Find the array of diagonse's children. ex: io, net, memory
+ // Add diagnose routes
extraDiagnoseRoute.forEach(item => {
addRoute(routes, item.path, item.component)
});
+ // Add app_observer routes
+ extraAppObserverRoute.forEach(item => {
+ addRoute(routes, item.path, item.component)
+ });
+
// Filter the menu by enable_services
if (enable_services.length > 0) {
rootPath.routes = rootPath.routes.filter(v => !menuNameMapServiceName[v.name] || enable_services.find(v2 => v2 == menuNameMapServiceName[v.name]))
@@ -197,6 +203,7 @@ export function patchRoutes({ routes }) {
import grafanaDash from './pages/Monitor/grafana'
import diagnose_component from './pages/diagnose/diagnose';
+import appobserver_component from './pages/app_observable';
export function render(oldRender) {
//Add Grafana dashboard dynamically
@@ -255,6 +262,30 @@ export function render(oldRender) {
component: diagnose_component
})
});
+ return requestURL("/resource/app_observable/v1/locales.json");
+ })
+ .then((res) => {
+ // 1. Add app_observer locales
+ Object.entries(res["locales"]).map(item => {
+ if (item[0] != "version") {
+ addLocale(item[0], item[1]);
+ }
+ });
+
+ // 2. Add app_observer menu and components
+ extraAppObserverRoute = [];
+ res["menus"].forEach(item => {
+ // menu.app_observable.ntopo
+ let configPath = item.split('.');
+ // app_observable.ntopo
+ configPath.shift();
+ console.log(configPath);
+ extraAppObserverRoute.push({
+ path: `/${configPath.join('/')}`,
+ component: appobserver_component
+ })
+ });
+
// Request services list, used to disable not running services
return requestURL("/api/v1/monitor/services/list")
})
diff --git a/sysom_web/src/locales/en-US/menu.js b/sysom_web/src/locales/en-US/menu.js
index 69fed21a..44f24699 100644
--- a/sysom_web/src/locales/en-US/menu.js
+++ b/sysom_web/src/locales/en-US/menu.js
@@ -156,10 +156,9 @@ export default {
'menu.diagnose.memory.market': 'RAM disk',
'menu.vmcore.analyse': 'Online Analysis',
'menu.app_observable': 'Application Observability',
- 'menu.app_observable.net_topo': 'Network Topology',
- 'menu.app_observable.mysql': 'MySQL Observability',
- 'menu.app_observable.java': 'Java Observability',
- 'menu.app_observable.process': 'Process Observability',
- 'menu.app_observable.nginx': 'Nginx Observability',
- 'menu.app_observable.jitter': 'Jitter Observability'
+ // 'menu.app_observable.net_topo': 'Network Topology',
+ // 'menu.app_observable.mysql': 'MySQL Observability',
+ // 'menu.app_observable.java': 'Java Observability',
+ // 'menu.app_observable.process': 'Process Observability',
+ // 'menu.app_observable.nginx': 'Nginx Observability',
};
diff --git a/sysom_web/src/locales/zh-CN/menu.js b/sysom_web/src/locales/zh-CN/menu.js
index b0a31a44..01e24f0c 100644
--- a/sysom_web/src/locales/zh-CN/menu.js
+++ b/sysom_web/src/locales/zh-CN/menu.js
@@ -113,10 +113,10 @@ export default {
'menu.hotfix.version.config': '操作系统配置',
'menu.hotfix.version.customize': '内核版本配置',
'menu.app_observable': '应用可观测',
- 'menu.app_observable.net_topo': '网络拓扑',
- 'menu.app_observable.mysql': 'MySQL可观测',
- 'menu.app_observable.java': 'Java可观测',
- 'menu.app_observable.process': '进程可观测',
- 'menu.app_observable.nginx': 'Nginx可观测',
- 'menu.app_observable.jitter': '抖动可观测'
+ // 'menu.app_observable.net_topo': '网络拓扑',
+ // 'menu.app_observable.mysql': 'MySQL可观测',
+ // 'menu.app_observable.java': 'Java可观测',
+ // 'menu.app_observable.process': '进程可观测',
+ // 'menu.app_observable.nginx': 'Nginx可观测',
+ // 'menu.app_observable.jitter': '抖动可观测'
};
\ No newline at end of file
diff --git a/sysom_web/src/pages/app_observable/components/multiGrafanaPannel.js b/sysom_web/src/pages/app_observable/components/multiGrafanaPannel.js
index 0d9c7d5b..e1abcb23 100644
--- a/sysom_web/src/pages/app_observable/components/multiGrafanaPannel.js
+++ b/sysom_web/src/pages/app_observable/components/multiGrafanaPannel.js
@@ -1,5 +1,6 @@
import { Tabs } from 'antd';
-import { useState, useEffect, useRef } from 'react';
+import { useState, useEffect, useRef} from 'react';
+import { useIntl } from 'umi';
import GrafanaWrap from '../../Monitor/grafana'
@@ -23,15 +24,27 @@ const useGetState = (initVal) => {
/**
* 多面板配置
- * {
- * "pannelId": "monitor_pannel",
- * "pannelName": "监控面板",
- * "pannelUrl": "/grafana/d/hOk70b34k/app-mysql",
- * }
+{
+ "menuName": "menu.app_observable.nginx",
+ "type": "multiGrafanaPannel",
+ "config": [
+ {
+ "pannelId": "nginx_monitor",
+ "pannelName": "pages.app_observable.monitor_dashboard",
+ "pannelUrl": "/grafana/d/6Mztrm4Ik/nginx"
+ },
+ {
+ "pannelId": "nginx_event",
+ "pannelName": "pages.app_observable.abnormal_events",
+ "pannelUrl": "/grafana/d/HtuWUeSSz/nginx-event"
+ }
+ ]
+}
* @param {*} props
*/
const MultiGrafanaPannel = (props) => {
- let pannels = props.pannels
+ const intl = useIntl();
+ let pannels = props.config
let pannelMap = {}
pannels.map((pannel) => {
pannelMap[pannel.pannelId] = pannel
@@ -42,7 +55,6 @@ const MultiGrafanaPannel = (props) => {
const [getter, setter] = useGetState(pannel.pannelUrl);
pannelGetter[pannel.pannelId] = getter
pannelSetter[pannel.pannelId] = setter
-
})
const [currentTab, setCurrentTab, getCurrentTab] = useGetState(pannels[0]["pannelId"]);
@@ -67,7 +79,10 @@ const MultiGrafanaPannel = (props) => {
let items = pannels.map((pannel) => {
return {
- label: pannel.pannelName,
+ label: intl.formatMessage({
+ id: pannel.pannelName,
+ defaultMessage: pannel.pannelName,
+ }),
key: pannel.pannelId,
forceRender: true,
children: (
@@ -81,21 +96,25 @@ const MultiGrafanaPannel = (props) => {
return
}
if (getCurrentTab() == pannel.pannelId) {
+ let targetPannelId = pannel.pannelId;
for (let otherPannelId in pannelGetter) {
if (otherPannelId == pannel.pannelId) {
continue
}
pannelSetter[otherPannelId](newUrl.replace(pannelMap[pannel.pannelId]["pannelUrl"], pannelMap[otherPannelId]["pannelUrl"]));
if (newUrl.indexOf(pannelMap[otherPannelId]["pannelUrl"]) >= 0) {
- setCurrentTab(otherPannelId);
+ targetPannelId = otherPannelId;
}
}
+ if (targetPannelId != pannel.pannelId) {
+ setCurrentTab(targetPannelId);
+ }
}
}}
urlChangeInvokeInterval={50}
/>
:
- {pannel.pannelId}1111
+ {pannel.pannelId}
}
)
diff --git a/sysom_web/src/pages/app_observable/components/singleGrafanaPannel.js b/sysom_web/src/pages/app_observable/components/singleGrafanaPannel.js
new file mode 100644
index 00000000..711014ff
--- /dev/null
+++ b/sysom_web/src/pages/app_observable/components/singleGrafanaPannel.js
@@ -0,0 +1,39 @@
+import GrafanaWrap from '../../Monitor/grafana'
+
+/**
+ * 单面板配置
+{
+ "menuName": "menu.app_observable.ntopo",
+ "type": "multiGrafanaPannel",
+ "config": {
+ "pannelId": "ntopo",
+ "pannelName": "",
+ "pannelUrl": "/grafana/d/H04tHN34k/ntopo"
+ },
+ "locales": {
+ "zh-CN": {
+ "menu.app_observable.ntopo": "网络拓扑"
+ },
+ "en-US": {
+ "menu.app_observable.ntopo": "Network Topology"
+ }
+ }
+}
+ * @param {*} props
+ */
+const SingleGrafanaPannel = (props) => {
+ const queryParams = !!props.queryParams ? props.queryParams : {};
+ // queryParams to query string
+ const queryStr = Object.keys(queryParams).map(key => key + '=' + queryParams[key]).join('&').trim();
+ let targetUrl = props.config.pannelUrl;
+ if (queryStr.length > 0) {
+ targetUrl += `?${queryStr}`
+ }
+ return (
+
+
+
+ )
+};
+
+export default SingleGrafanaPannel;
\ No newline at end of file
diff --git a/sysom_web/src/pages/app_observable/index.js b/sysom_web/src/pages/app_observable/index.js
new file mode 100644
index 00000000..207b6608
--- /dev/null
+++ b/sysom_web/src/pages/app_observable/index.js
@@ -0,0 +1,42 @@
+import { useEffect, useState } from 'react';
+import { request } from 'umi';
+import MultiGrafanaPannel from './components/multiGrafanaPannel';
+import SingleGrafanaPannel from './components/singleGrafanaPannel';
+
+const components = {
+ "multiGrafanaPannel": MultiGrafanaPannel,
+ "singleGrafanaPannel": SingleGrafanaPannel
+}
+
+/**
+ * 应用观测动态渲染
+ * @returns
+ */
+const AppObservable = (props) => {
+ const [pannelConfig, setPannelConfig] = useState();
+ useEffect(() => {
+ console.log("useEffect");
+ // Get config
+ let urlslice = props.match.url.split("/");
+ urlslice.splice(2, 0, "v1");
+ request(`/resource${urlslice.join("/")}.json`)
+ .then((res) => {
+ console.log("setPannelConfig", res);
+ setPannelConfig(res);
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+ }, []);
+ if (!pannelConfig) {
+ return <>>;
+ }
+ let pannelType = pannelConfig.type;
+ if (!(pannelType in components)) {
+ return <>>;
+ }
+ let Component = components[pannelType];
+ return ();
+};
+
+export default AppObservable;
\ No newline at end of file
diff --git a/sysom_web/src/pages/app_observable/mysql/index.js b/sysom_web/src/pages/app_observable/mysql/index.js
index 93c1cf95..a7532ed8 100644
--- a/sysom_web/src/pages/app_observable/mysql/index.js
+++ b/sysom_web/src/pages/app_observable/mysql/index.js
@@ -1,28 +1,5 @@
-import { Tabs } from 'antd';
-import { useState, useEffect, useRef } from 'react';
-import GrafanaWrap from '../../Monitor/grafana'
import { useIntl } from 'umi';
-
-const monitorPannelTargetUrlBase = '/grafana/d/hOk70b34k/app-mysql';
-const abnormalEventsTargetUrlBase = '/grafana/d/Ub__1x3Vz/app-mysql-events';
-
-/**
- * 封装 useState,使其具有 getState 方法,保证在回调函数中获取到的 state 值是最新的
- * (由于闭包,直接在回调函数中使用state获取到的不是最新值)
- * @param {*} initVal
- * @reference https://www.haorooms.com/post/usegetstate_hooks
- * @returns
- */
-const useGetState = (initVal) => {
- const [state, setState] = useState(initVal);
- const ref = useRef(initVal);
- const setStateCopy = (newVal) => {
- ref.current = newVal;
- setState(newVal);
- }
- const getState = () => ref.current;
- return [state, setStateCopy, getState];
-}
+import MultiGrafanaPannel from '../components/multiGrafanaPannel';
/**
* MySQL应用观测
@@ -30,100 +7,29 @@ const useGetState = (initVal) => {
*/
const AppObservableMysql = (props) => {
const intl = useIntl();
- const [monitorPannelTargetUrl, setMonitorPannelTargetUrl] = useState(monitorPannelTargetUrlBase);
- const [abnormalEventsTargetUrl, setAbnormalEventsTargetUrl] = useState(abnormalEventsTargetUrlBase);
- const [currentTab, setCurrentTab, getCurrentTab] = useGetState('monitor_panenl');
-
- useEffect(() => {
- const queryParams = !!props.location?.query ? props.location.query : {};
- console.log(queryParams);
- if ('_currentTab' in queryParams) {
- let _currentTab = queryParams._currentTab;
- if (_currentTab == 'abnormal_events') {
- setCurrentTab('abnormal_events');
- } else {
- setCurrentTab('monitor_panenl');
- }
- }
- // queryParams to query string
- const queryStr = Object.keys(queryParams).map(key => key + '=' + queryParams[key]).join('&').trim();
- if (queryStr.length > 0) {
- setMonitorPannelTargetUrl(monitorPannelTargetUrlBase + `?${queryStr}`);
- setAbnormalEventsTargetUrl(abnormalEventsTargetUrlBase + `?${queryStr}`);
- }
- }, []);
-
- const monitor_panenl = {
- label: intl.formatMessage({
- id: 'pages.app_observable.monitor_dashboard',
- defaultMessage: 'Monitor Dashboard',
- }),
- key: "monitor_panenl",
- forceRender: true,
- children: (
-
+ return (
+ {
- if (getCurrentTab() == 'monitor_panenl') {
- setAbnormalEventsTargetUrl(newUrl.replace(monitorPannelTargetUrlBase, abnormalEventsTargetUrlBase));
- if (newUrl.indexOf(abnormalEventsTargetUrlBase) >= 0) {
- setCurrentTab('abnormal_events');
- }
- }
- }}
- urlChangeInvokeInterval={100}
- />
- :
- monitor_panenl
- }
-
- )
- }
-
- const abnormal_events = {
- label: intl.formatMessage({
- id: 'pages.app_observable.abnormal_events',
- defaultMessage: 'Abnormal Events',
- }),
- key: "abnormal_events",
- forceRender: true,
- children: (
-
+ "pannelId": "mysql_monitor",
+ "pannelName": intl.formatMessage({
+ id: 'pages.app_observable.monitor_dashboard',
+ defaultMessage: 'Monitor Dashboard',
+ }),
+ "pannelUrl": '/grafana/d/hOk70b34k/app-mysql',
+ },
{
- currentTab == "abnormal_events" ?
- {
- if (getCurrentTab() == 'abnormal_events') {
- setMonitorPannelTargetUrl(newUrl.replace(abnormalEventsTargetUrlBase, monitorPannelTargetUrlBase));
- if (newUrl.indexOf(monitorPannelTargetUrlBase) >= 0) {
- setCurrentTab('monitor_panenl');
- }
- }
- }}
- urlChangeInvokeInterval={100}
- />
- :
- abnormal_events
+ "pannelId": "mysql_event",
+ "pannelName": intl.formatMessage({
+ id: 'pages.app_observable.abnormal_events',
+ defaultMessage: 'Abnormal Events',
+ }),
+ "pannelUrl": '/grafana/d/Ub__1x3Vz/app-mysql-events',
}
-
-
- )
- }
- return (
-
- {
- setCurrentTab(key);
- }}
- />
-
+ ]}
+ {...props}
+ />
)
};
+
export default AppObservableMysql;
\ No newline at end of file
--
Gitee
From bef1b2ff5da4ac507420283234e7ca646e5ed519 Mon Sep 17 00:00:00 2001
From: xiaozhenwei
Date: Thu, 14 Dec 2023 10:13:42 +0800
Subject: [PATCH 025/176] update mysql application observation panels
---
.../sysom-appobserver-mysql-dashboard.json | 1235 +++++++++++------
...om-appobserver-mysql-events-dashboard.json | 186 ++-
2 files changed, 914 insertions(+), 507 deletions(-)
diff --git a/deps/4_grafana/sysom-appobserver-mysql-dashboard.json b/deps/4_grafana/sysom-appobserver-mysql-dashboard.json
index 629f4913..2dc45262 100644
--- a/deps/4_grafana/sysom-appobserver-mysql-dashboard.json
+++ b/deps/4_grafana/sysom-appobserver-mysql-dashboard.json
@@ -26,270 +26,22 @@
"links": [],
"liveNow": false,
"panels": [
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 0
- },
- "id": 71,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "table",
- "placement": "right",
- "showLegend": true
- },
- "tooltip": {
- "mode": "multi",
- "sort": "none"
- }
- },
- "pluginVersion": "9.2.2",
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "exemplar": false,
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"curriops\"}",
- "legendFormat": "{{disk}}.iops",
- "range": true,
- "refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"iopsBaseThresh\"}",
- "hide": false,
- "legendFormat": "{{disk}}.iopsBaseThresh",
- "range": true,
- "refId": "B"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"iopsComThresh\"}",
- "hide": false,
- "legendFormat": "{{disk}}.iopsComThresh",
- "range": true,
- "refId": "C"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"iopsMoveAvg\"}",
- "hide": false,
- "legendFormat": "{{disk}}.iopsMoveAvg",
- "range": true,
- "refId": "D"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"iopsThresh\"}",
- "hide": false,
- "legendFormat": "{{disk}}.iopsThresh",
- "range": true,
- "refId": "E"
- }
- ],
- "title": "iops异常检测追踪",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 0
- },
- "id": 72,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "table",
- "placement": "right",
- "showLegend": true
- },
- "tooltip": {
- "mode": "multi",
- "sort": "none"
- }
- },
- "pluginVersion": "9.2.2",
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "exemplar": false,
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"currbps\"}",
- "legendFormat": "{{disk}}.bps",
- "range": true,
- "refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"bpsThresh\"}",
- "hide": false,
- "legendFormat": "{{disk}}.bpsThresh",
- "range": true,
- "refId": "B"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"bpsMoveAvg\"}",
- "hide": false,
- "legendFormat": "{{disk}}.bpsMoveAvg",
- "range": true,
- "refId": "C"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"bpsComThresh\"}",
- "hide": true,
- "legendFormat": "{{disk}}.bpsComThresh",
- "range": true,
- "refId": "D"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_debugDynThreshTlb{exported_instance=\"$hostIP\",value=\"bpsBaseThresh\"}",
- "hide": true,
- "legendFormat": "{{disk}}.bpsBaseThresh",
- "range": true,
- "refId": "E"
- }
- ],
- "title": "iops异常检测追踪",
- "type": "timeseries"
- },
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
- "y": 8
+ "y": 0
},
"id": 69,
"panels": [],
- "title": "Mysql alarm statics",
+ "title": "MySQL\u5f02\u5e38\u544a\u8b66\u7c7b\u578b\u7edf\u8ba1",
"type": "row"
},
{
"datasource": "sysom-prometheus",
+ "description": "mysql\u670d\u52a1\u5728OS\u4e2d\u88ab\u89c2\u6d4b\u5230\u53ef\u80fd\u5b58\u5728\u7684\u5f02\u5e38\u544a\u8b66\u4e8b\u4ef6\u7edf\u8ba1\u4fe1\u606f",
"fieldConfig": {
"defaults": {
"color": {
@@ -403,7 +155,7 @@
"h": 5,
"w": 24,
"x": 0,
- "y": 9
+ "y": 1
},
"id": 64,
"links": [],
@@ -427,8 +179,9 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_Mysql_Error_Type\"}",
+ "hide": false,
"interval": "35",
- "legendFormat": "Mysql Error Alarm",
+ "legendFormat": "MySQL Error Alarm",
"range": true,
"refId": "A"
},
@@ -438,7 +191,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_Mysql_Slow_Sql_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql Slow_Sql Alarm",
+ "legendFormat": "MySQL Slow_Sql Alarm",
"range": true,
"refId": "B"
},
@@ -448,7 +201,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_Net_Drops_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql Net_Drops Alarm",
+ "legendFormat": "MySQL Net_Drops Alarm",
"range": true,
"refId": "C"
},
@@ -458,7 +211,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_OOM_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql OOM Alarm",
+ "legendFormat": "MySQL OOM Alarm",
"range": true,
"refId": "D"
},
@@ -468,7 +221,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_RT_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql RT Alarm",
+ "legendFormat": "MySQL RT Alarm",
"range": true,
"refId": "E"
},
@@ -478,7 +231,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Process_Sched_Delay_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql Sched_Delay Alarm",
+ "legendFormat": "MySQL Sched_Delay Alarm",
"range": true,
"refId": "F"
},
@@ -488,7 +241,7 @@
"expr": "sysom_obser_mysqld_alarm{containerId=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"Alarm_Long_Time_D_Type\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Mysql Long_Time_D Alarm",
+ "legendFormat": "MySQL Long_Time_D Alarm",
"range": true,
"refId": "G"
},
@@ -582,7 +335,7 @@
"refId": "P"
}
],
- "title": "异常告警分布(次数)",
+ "title": "\u5f02\u5e38\u544a\u8b66\u5206\u5e03\uff08\u6b21\u6570\uff09",
"type": "bargauge"
},
{
@@ -591,11 +344,11 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 14
+ "y": 6
},
"id": 26,
"panels": [],
- "title": "Mysql resource usage",
+ "title": "MySQL\u8d44\u6e90\u4f7f\u7528\u8be6\u60c5",
"type": "row"
},
{
@@ -622,7 +375,7 @@
{
"matcher": {
"id": "byName",
- "options": "缓存线程数"
+ "options": "\u7f13\u5b58\u7ebf\u7a0b\u6570"
},
"properties": [
{
@@ -642,7 +395,7 @@
{
"matcher": {
"id": "byName",
- "options": "创建线程数"
+ "options": "\u521b\u5efa\u7ebf\u7a0b\u6570"
},
"properties": [
{
@@ -666,7 +419,7 @@
{
"matcher": {
"id": "byName",
- "options": "运行线程数"
+ "options": "\u8fd0\u884c\u7ebf\u7a0b\u6570"
},
"properties": [
{
@@ -690,7 +443,7 @@
{
"matcher": {
"id": "byName",
- "options": "连接线程数"
+ "options": "\u8fde\u63a5\u7ebf\u7a0b\u6570"
},
"properties": [
{
@@ -717,7 +470,7 @@
"h": 5,
"w": 24,
"x": 0,
- "y": 15
+ "y": 7
},
"id": 38,
"options": {
@@ -741,7 +494,7 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"threadCached\"}",
"hide": false,
"interval": "35",
- "legendFormat": "缓存线程数",
+ "legendFormat": "\u7f13\u5b58\u7ebf\u7a0b\u6570",
"range": true,
"refId": "A"
},
@@ -751,7 +504,7 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"threadCreated\"}",
"hide": false,
"interval": "35",
- "legendFormat": "创建线程总数",
+ "legendFormat": "\u521b\u5efa\u7ebf\u7a0b\u603b\u6570",
"range": true,
"refId": "B"
},
@@ -761,7 +514,7 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"threadRunning\"}",
"hide": false,
"interval": "35",
- "legendFormat": "运行线程数",
+ "legendFormat": "\u8fd0\u884c\u7ebf\u7a0b\u6570",
"range": true,
"refId": "C"
},
@@ -771,7 +524,7 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"threadConnected\"}",
"hide": false,
"interval": "35",
- "legendFormat": "连接线程数",
+ "legendFormat": "\u8fde\u63a5\u7ebf\u7a0b\u6570",
"range": true,
"refId": "E"
},
@@ -781,12 +534,12 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"maxConnection\"}",
"hide": false,
"interval": "35",
- "legendFormat": "最大连接限制",
+ "legendFormat": "\u6700\u5927\u8fde\u63a5\u9650\u5236",
"range": true,
"refId": "D"
}
],
- "title": "mysql 连接线程池使用",
+ "title": "mySQL \u8fde\u63a5\u7ebf\u7a0b\u6c60\u4f7f\u7528",
"type": "gauge"
},
{
@@ -850,7 +603,7 @@
"h": 8,
"w": 8,
"x": 0,
- "y": 20
+ "y": 12
},
"id": 17,
"options": {
@@ -904,12 +657,12 @@
"refId": "C"
}
],
- "title": "Mysql CPU占用率",
+ "title": "MySQL CPU\u5360\u7528\u7387",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "\u4e00\u822c\u5730\u5360\u6bd4\u8d8a\u4f4e\u8d8a\u597d\uff0c\u5360\u6bd4\u8d8a\u9ad8\uff0c\u8bf4\u660e\u7cfb\u7edf\u5206\u914d\u7ed9mysql\u7684CPU\u65f6\u95f4\u7247\u7ecf\u5e38\u5904\u4e8e\u672a\u4f7f\u7528\u5b8c\u5c31\u88ab\u5207\u6362\u51fa\u53bb\u7684\u72b6\u6001",
"fieldConfig": {
"defaults": {
"color": {
@@ -968,7 +721,7 @@
"h": 8,
"w": 8,
"x": 8,
- "y": 20
+ "y": 12
},
"id": 18,
"options": {
@@ -996,12 +749,12 @@
"expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"cpuGiveup\"}",
"hide": false,
"interval": "35",
- "legendFormat": "让出率",
+ "legendFormat": "\u8ba9\u51fa\u7387",
"range": true,
"refId": "A"
}
],
- "title": "Mysql CPU让出率",
+ "title": "MySQL CPU\u8ba9\u51fa\u7387",
"type": "timeseries"
},
{
@@ -1061,7 +814,7 @@
"h": 8,
"w": 8,
"x": 16,
- "y": 20
+ "y": 12
},
"id": 42,
"links": [],
@@ -1127,13 +880,13 @@
"hide": false,
"interval": "35",
"intervalFactor": 1,
- "legendFormat": "长事务数",
+ "legendFormat": "\u957f\u4e8b\u52a1\u6570",
"range": true,
"refId": "D",
"step": 240
}
],
- "title": "Mysql Undolog链表长度&长事务",
+ "title": "MySQL Undolog\u94fe\u8868\u957f\u5ea6&\u957f\u4e8b\u52a1",
"type": "timeseries"
},
{
@@ -1162,7 +915,7 @@
"h": 7,
"w": 8,
"x": 0,
- "y": 28
+ "y": 20
},
"id": 34,
"options": {
@@ -1198,7 +951,7 @@
"editorMode": "code",
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"bufferPoolFree\"}",
"interval": "35",
- "legendFormat": "空闲",
+ "legendFormat": "\u7a7a\u95f2",
"range": true,
"refId": "A"
},
@@ -1208,12 +961,12 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"bufferPoolTotal\"}-on(podID)sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"bufferPoolFree\"}",
"hide": false,
"interval": "35",
- "legendFormat": "已用",
+ "legendFormat": "\u5df2\u7528",
"range": true,
"refId": "B"
}
],
- "title": "Mysql 内存缓存池使用",
+ "title": "MySQL \u5185\u5b58\u7f13\u5b58\u6c60\u4f7f\u7528",
"type": "piechart"
},
{
@@ -1240,7 +993,7 @@
"h": 7,
"w": 8,
"x": 8,
- "y": 28
+ "y": 20
},
"id": 62,
"options": {
@@ -1302,7 +1055,7 @@
"refId": "C"
}
],
- "title": "Mysql OS内存使用分布",
+ "title": "MySQL OS\u5185\u5b58\u4f7f\u7528\u5206\u5e03",
"transformations": [],
"type": "piechart"
},
@@ -1360,7 +1113,7 @@
{
"matcher": {
"id": "byName",
- "options": "空闲"
+ "options": "\u7a7a\u95f2"
},
"properties": [
{
@@ -1375,7 +1128,7 @@
{
"matcher": {
"id": "byName",
- "options": "已用"
+ "options": "\u5df2\u7528"
},
"properties": [
{
@@ -1393,7 +1146,7 @@
"h": 7,
"w": 8,
"x": 16,
- "y": 28
+ "y": 20
},
"id": 36,
"options": {
@@ -1431,7 +1184,7 @@
"editorMode": "code",
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"chkPointUsage\"}",
"interval": "35",
- "legendFormat": "已用",
+ "legendFormat": "\u5df2\u7528",
"range": true,
"refId": "A"
},
@@ -1441,12 +1194,12 @@
"expr": "sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"redologCapacity\"}-on(containerID)sysom_obser_mysqld_innodb{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"chkPointUsage\"}",
"hide": false,
"interval": "35",
- "legendFormat": "空闲",
+ "legendFormat": "\u7a7a\u95f2",
"range": true,
"refId": "B"
}
],
- "title": "Mysql Redolog使用量",
+ "title": "MySQL Redolog\u4f7f\u7528\u91cf",
"type": "piechart"
},
{
@@ -1455,16 +1208,16 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 35
+ "y": 27
},
"id": 54,
"panels": [],
- "title": "Mysql latency details",
+ "title": "MySQL RT\u5ef6\u8fdf\u8be6\u60c5",
"type": "row"
},
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "mysql\u670d\u52a1\u4fa7\u63a5\u53d7\u5230\u4e00\u4e2a\u8bf7\u6c42\uff0c\u5230\u5904\u7406\u5b8c\u4e4b\u540e\uff0c\u56de\u5e94\u5ba2\u6237\u7aef\u8fd9\u4e00\u8fc7\u7a0b\u7684\u603b\u65f6\u95f4\u6d88\u8017\u3002\u8fd9\u91cc\u5c55\u793a\u7684\u662f\u5e73\u5747RT\u503c",
"fieldConfig": {
"defaults": {
"color": {
@@ -1513,7 +1266,7 @@
}
]
},
- "unit": "µs"
+ "unit": "\u00b5s"
},
"overrides": []
},
@@ -1521,7 +1274,7 @@
"h": 9,
"w": 8,
"x": 0,
- "y": 36
+ "y": 28
},
"id": 46,
"options": {
@@ -1575,11 +1328,12 @@
"refId": "C"
}
],
- "title": "Mysql RT",
+ "title": "MySQL RT",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
+ "description": "\u5bf9\u5e94\u4e0d\u540c\u8fde\u63a5\u7684\u8bf7\u6c42\u8be6\u60c5\uff0c\u53f3\u4fa7\u7684\u201cRT\u5206\u6790\u201d\u53ef\u4ee5\u8df3\u8f6c\u5230RT\u5ef6\u8fdf\u8bca\u65ad\uff0c\u8fdb\u4e00\u6b65\u5c06RT\u5ef6\u8fdf\u7ec6\u7c92\u5ea6\u5c55\u5f00",
"fieldConfig": {
"defaults": {
"color": {
@@ -1740,7 +1494,7 @@
"value": [
{
"targetBlank": true,
- "title": "RT根因分析",
+ "title": "RT\u6839\u56e0\u5206\u6790",
"url": "../diagnose/link/rtdelay?instance=${__data.fields.exported_instance}&pid=${__data.fields.Pid}&time=10"
}
]
@@ -1756,7 +1510,7 @@
"options": {
"true": {
"index": 0,
- "text": "RT分析"
+ "text": "RT\u5206\u6790"
}
},
"type": "value"
@@ -1813,7 +1567,7 @@
"properties": [
{
"id": "unit",
- "value": "µs"
+ "value": "\u00b5s"
},
{
"id": "thresholds",
@@ -1844,7 +1598,7 @@
"properties": [
{
"id": "unit",
- "value": "µs"
+ "value": "\u00b5s"
},
{
"id": "thresholds",
@@ -1921,7 +1675,7 @@
"h": 9,
"w": 16,
"x": 8,
- "y": 36
+ "y": 28
},
"id": 50,
"options": {
@@ -1952,7 +1706,7 @@
"refId": "B"
}
],
- "title": "Mysql请求详情",
+ "title": "MySQL\u8bf7\u6c42\u8be6\u60c5",
"transformations": [
{
"id": "joinByField",
@@ -2286,7 +2040,7 @@
},
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "mysql\u7b49\u5f85\u7cfb\u7edfIO\u8d44\u6e90\u65f6\u6240\u6d88\u8017\u65f6\u95f4\uff0c\u4e00\u822c\u5730\uff0c\u5728\u6709IO\u60c5\u51b5\u4e0b\uff0c\u8be5\u6307\u6807\u5e94\u8d8a\u4f4e\u8d8a\u597d\uff0c\u8bf4\u660e\u7cfb\u7edfIO\u8d44\u6e90\u53ef\u4ee5\u65e0\u963b\u788d\u5730\u83b7\u53d6\uff0c\u5982\u51fa\u73b0\u98d9\u5347\uff0c\u53ef\u80fd\u5f15\u8d77\u670d\u52a1\u8fdb\u7a0b\u963b\u585e",
"fieldConfig": {
"defaults": {
"color": {
@@ -2332,7 +2086,7 @@
}
]
},
- "unit": "µs"
+ "unit": "\u00b5s"
},
"overrides": []
},
@@ -2340,7 +2094,7 @@
"h": 9,
"w": 8,
"x": 0,
- "y": 45
+ "y": 37
},
"id": 22,
"options": {
@@ -2373,12 +2127,12 @@
"refId": "A"
}
],
- "title": "Mysql 等待IO资源延迟(平均每秒)",
+ "title": "MySQL \u7b49\u5f85IO\u8d44\u6e90\u5ef6\u8fdf(\u5e73\u5747\u6bcf\u79d2)",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "mysql\u8bbf\u95ee\u5185\u5b58\u65f6\u6240\u6d88\u8017\u65f6\u95f4\uff0c\u4e00\u822c\u5730\uff0c\u8be5\u6307\u6807\u5e94\u63a5\u8fd1\u4e8e0\uff0c\u8bf4\u660e\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u53ef\u4ee5\u65e0\u963b\u788d\u5730\u83b7\u53d6\uff0c\u5982\u51fa\u73b0\u98d9\u5347\uff0c\u53ef\u80fd\u5f15\u8d77\u670d\u52a1\u8fdb\u7a0b\u963b\u585e",
"fieldConfig": {
"defaults": {
"color": {
@@ -2432,7 +2186,7 @@
"h": 9,
"w": 8,
"x": 8,
- "y": 45
+ "y": 37
},
"id": 60,
"options": {
@@ -2465,12 +2219,12 @@
"refId": "A"
}
],
- "title": "Mysql申请OS内存延迟",
+ "title": "MySQL\u7533\u8bf7OS\u5185\u5b58\u5ef6\u8fdf",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
- "description": "在就绪队列中等待的时间",
+ "description": "mysql\u5728\u5c31\u7eea\u961f\u5217\u4e2d\u7b49\u5f85\u5206\u914dCPU\u8d44\u6e90\uff0c\u88ab\u8c03\u5ea6\u7684\u65f6\u95f4\uff0c\u8be5\u6307\u6807\u6700\u597d\u662f\u63a5\u8fd1\u4e8e0\uff0c\u5426\u5219\uff0c\u8bf4\u660e\u5f53\u524dmysql\u5b9e\u4f8b\u5185CPU\u8d44\u6e90\u7d27\u5f20",
"fieldConfig": {
"defaults": {
"color": {
@@ -2528,7 +2282,7 @@
"h": 9,
"w": 8,
"x": 16,
- "y": 45
+ "y": 37
},
"id": 28,
"options": {
@@ -2555,30 +2309,17 @@
"editorMode": "code",
"expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"schedDelay\"}",
"interval": "35",
- "legendFormat": "调度延迟",
+ "legendFormat": "\u8c03\u5ea6\u5ef6\u8fdf",
"range": true,
"refId": "A"
}
],
- "title": "Mysql OS调度延迟",
+ "title": "MySQL OS\u8c03\u5ea6\u5ef6\u8fdf",
"type": "timeseries"
},
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 54
- },
- "id": 24,
- "panels": [],
- "title": "Mysql throughput details",
- "type": "row"
- },
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "\u5c06mysql\u7684\u6570\u636eIO\u603b\u6d88\u8017\u5ef6\u8fdf\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u7ec6\u5206\u5728OS\uff08\u5305\u542b\u5185\u6838block\u5b50\u7cfb\u7edf\u3001\u786c\u76d8\u9a71\u52a8\u3001IO\u6536\u5272\u3001\u5b8c\u6210IO\u65f6\u5524\u9192\u524d\u53f0\u5e94\u7528\u8fdb\u7a0b\u7b49\u5404\u9636\u6bb5\u6240\u6d88\u8017\u5ef6\u8fdf\uff09\u3001\u786c\u76d8\u5ef6\u8fdf\u6d88\u8017",
"fieldConfig": {
"defaults": {
"color": {
@@ -2589,7 +2330,6 @@
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
- "axisSoftMax": 4,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
@@ -2601,7 +2341,564 @@
},
"lineInterpolation": "smooth",
"lineWidth": 1,
- "pointSize": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "\u00b5s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 8,
+ "x": 0,
+ "y": 46
+ },
+ "id": 71,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"total_delay\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.Total_delay",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"disk\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.Disk_delay",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"total_delay\"}) - avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"disk\"})",
+ "hide": true,
+ "interval": "35",
+ "legendFormat": "MySQL.OS_delay",
+ "range": true,
+ "refId": "G"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"block\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.OS_delay_by_io_block",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"driver\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.OS_delay_by_disk_driver",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"complete\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.OS_delay_by_io_complete",
+ "range": true,
+ "refId": "E"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg(sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"done\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "MySQL.OS_delay_by_io_done",
+ "range": true,
+ "refId": "F"
+ }
+ ],
+ "title": "MySQL\u6570\u636eIO\u5904\u7406\u5ef6\u8fdf\u5206\u5e03",
+ "transformations": [],
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "\u5c06mysql\u8fdb\u884cIO\u7684\u78c1\u76d8\u89c6\u89d2\u6765\u770b\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u67e5\u770b\u786c\u76d8\u6bcf\u786c\u4ef6\u961f\u5217\uff0c\u5904\u7406IO\u7684\u5ef6\u8fdf\u6d88\u8017\uff0c\u5e76\u7ec6\u5206\u5728OS\u3001\u786c\u76d8\u5ef6\u8fdf\u6d88\u8017",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "smooth",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "\u00b5s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 8,
+ "x": 8,
+ "y": 46
+ },
+ "id": 78,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname, queue_id) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"total_delay\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.Qid{{queue_id}}.Total_delay",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname, queue_id) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"disk\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.Qid{{queue_id}}.Disk_delay",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname, queue_id) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"total_delay\"}) - avg by(diskname, queue_id) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"disk\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.Qid{{queue_id}}.OS_delay",
+ "range": true,
+ "refId": "C"
+ }
+ ],
+ "title": "MySQL \u78c1\u76d8\u5404\u961f\u5217\u7ea7IO\u5ef6\u8fdf\u5206\u5e03",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "\u5c06mysql\u8fdb\u884cIO\u7684\u78c1\u76d8\u89c6\u89d2\u6765\u770b\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u67e5\u770bIO\u7684\u5ef6\u8fdf\u6d88\u8017\uff0c\u5e76\u7ec6\u5206\u5728OS\u3001\u786c\u76d8\u5ef6\u8fdf\u6d88\u8017",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "smooth",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": true,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "\u00b5s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 8,
+ "x": 16,
+ "y": 46
+ },
+ "id": 79,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"total_delay\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.Total_delay",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"disk\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.Disk_delay",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "avg by(diskname) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"total_delay\"}) - avg by(diskname) (sysom_iolatency{diskname=~\"$Disk_list\", exported_instance=\"$hostIP\", value=\"disk\"})",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{diskname}}.OS_delay",
+ "range": true,
+ "refId": "C"
+ }
+ ],
+ "title": "MySQL \u78c1\u76d8\u7ea7IO\u5ef6\u8fdf\u5206\u5e03",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "mysql\u4ea7\u751f\u6570\u636eIO\uff0c\u4f4d\u4e8e\u54ea\u4e9bCPU\u4e0a\uff0c\u989c\u8272\u8d8a\u6df1\uff0c\u8bf4\u660e\u5728\u6b64CPU\u7f16\u53f7\u8303\u56f4\u5185\u53d1\u8d77\u7684IO\u8bf7\u6c42\u8d8a\u591a\uff08Bucket\u4e3aCPU\u7f16\u53f7\u8303\u56f4\uff0ccount\u4e3aIO\u8bf7\u6c42\u6b21\u6570\uff09\uff1b\u7531\u4e8eCPU\u4e0e\u786c\u4ef6\u961f\u5217\u4e4b\u95f4\u5b58\u5728\u6620\u5c04\u5173\u7cfb\uff0c\u4e00\u822c\u5730\u7528\u4e8e\u5206\u6790\uff0c\u78c1\u76d8\u961f\u5217IO\u5206\u5e03\u4e0d\u5747\u5300\u7684\u60c5\u51b5\uff0c\u89c2\u6d4b\u4e1a\u52a1IO\u662f\u5426\u8db3\u591f\u6253\u6563\u3002",
+ "fieldConfig": {
+ "defaults": {
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "scaleDistribution": {
+ "type": "linear"
+ }
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 55
+ },
+ "id": 81,
+ "options": {
+ "calculate": true,
+ "calculation": {
+ "xBuckets": {
+ "mode": "size",
+ "value": "2m"
+ },
+ "yBuckets": {
+ "mode": "size",
+ "value": "1"
+ }
+ },
+ "cellGap": 0,
+ "cellValues": {},
+ "color": {
+ "exponent": 0.5,
+ "fill": "#cc0219",
+ "min": 0,
+ "mode": "opacity",
+ "reverse": true,
+ "scale": "linear",
+ "scheme": "Blues",
+ "steps": 33
+ },
+ "exemplars": {
+ "color": "rgba(255,0,255,0.7)"
+ },
+ "filterValues": {
+ "le": 1e-09
+ },
+ "legend": {
+ "show": true
+ },
+ "rowsFrame": {
+ "layout": "auto"
+ },
+ "tooltip": {
+ "show": true,
+ "yHistogram": false
+ },
+ "yAxis": {
+ "axisLabel": "CPUs",
+ "axisPlacement": "left",
+ "decimals": 1,
+ "min": 0,
+ "reverse": false,
+ "unit": "none"
+ }
+ },
+ "pluginVersion": "9.2.2",
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"initiated_cpu|issue_cpu\"}",
+ "legendFormat": "IO_Generate_Hot_Cpus",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "MySQL\u6bcfCPU\u751f\u4ea7IO\u8bf7\u6c42\u70ed\u529b\u5206\u5e03",
+ "type": "heatmap"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "\u54cd\u5e94\u78c1\u76d8\u5b8c\u6210IO\u7684\u4e2d\u65ad\u96c6\u4e2d\u5728\u54ea\u4e9bCPU\u4e0a\uff0c\u989c\u8272\u8d8a\u6df1\uff0c\u8bf4\u660e\u5728\u6b64CPU\u7f16\u53f7\u8303\u56f4\u5185\u5904\u7406\u7684IO\u4e2d\u65ad\u8d8a\u591a\u3002\u53ef\u4ee5\u89c2\u6d4b\u5b9e\u9645\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684IO\u76f8\u5e94\u4e2d\u65ad\u662f\u5426\u7b26\u5408\u78c1\u76d8\u786c\u4ef6\u961f\u5217\u4e2d\u65ad\u7ed1\u6838\u671f\u671b\uff0c\u4e00\u822c\u5730\uff0c\u6bcf\u786c\u4ef6\u961f\u5217\u7ed1\u5b9a\u4e00\u4e2aCPU\u6838",
+ "fieldConfig": {
+ "defaults": {
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "scaleDistribution": {
+ "type": "linear"
+ }
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 55
+ },
+ "id": 82,
+ "options": {
+ "calculate": true,
+ "calculation": {
+ "xBuckets": {
+ "mode": "size",
+ "value": "2m"
+ },
+ "yBuckets": {
+ "mode": "size",
+ "value": "1"
+ }
+ },
+ "cellGap": 1,
+ "cellValues": {},
+ "color": {
+ "exponent": 0.5,
+ "fill": "#e00a23",
+ "min": 0,
+ "mode": "opacity",
+ "reverse": true,
+ "scale": "linear",
+ "scheme": "Blues",
+ "steps": 33
+ },
+ "exemplars": {
+ "color": "rgba(255,0,255,0.7)"
+ },
+ "filterValues": {
+ "le": 1e-09
+ },
+ "legend": {
+ "show": true
+ },
+ "rowsFrame": {
+ "layout": "auto"
+ },
+ "tooltip": {
+ "show": true,
+ "yHistogram": false
+ },
+ "yAxis": {
+ "axisLabel": "CPUs",
+ "axisPlacement": "left",
+ "decimals": 1,
+ "min": 0,
+ "reverse": false,
+ "unit": "none"
+ }
+ },
+ "pluginVersion": "9.2.2",
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_iolatency{ppid=\"$Pid\", exported_instance=\"$hostIP\", value=~\"soft_interrupt_cpu|respond_cpu\"}",
+ "legendFormat": "IO_Complete_Hot_Cpus",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "MySQL\u6bcfCPU\u5904\u7406IO\u4e2d\u65ad\u70ed\u529b\u5206\u5e03",
+ "type": "heatmap"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 63
+ },
+ "id": 24,
+ "panels": [],
+ "title": "MySQL\u6d41\u91cf\u541e\u5410\u8be6\u60c5",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "The number of bytes read from or written to the device per second",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "bytes read (-) / write (+)",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 20,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "smooth",
+ "lineWidth": 1,
+ "pointSize": 2,
"scaleDistribution": {
"type": "linear"
},
@@ -2615,12 +2912,17 @@
"mode": "off"
}
},
+ "links": [],
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
}
]
},
@@ -2632,56 +2934,60 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 55
+ "y": 64
},
- "id": 47,
+ "id": 20,
+ "links": [],
"options": {
"legend": {
"calcs": [
- "min",
"mean",
+ "lastNotNull",
"max",
- "lastNotNull"
+ "min"
],
"displayMode": "table",
"placement": "bottom",
- "showLegend": true,
- "width": 0
+ "showLegend": true
},
"tooltip": {
"mode": "multi",
- "sort": "desc"
+ "sort": "none"
}
},
- "pluginVersion": "9.2.2",
+ "pluginVersion": "9.2.0",
"targets": [
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"netRecTraffic\"}",
- "hide": false,
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"ioReadBps\"}",
+ "format": "time_series",
"interval": "35",
- "legendFormat": "netRecTraffic",
+ "intervalFactor": 4,
+ "legendFormat": "rBPS",
"range": true,
- "refId": "A"
+ "refId": "A",
+ "step": 240
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"netSendTraffic\"}",
- "hide": false,
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"ioWriteBps\"}",
+ "format": "time_series",
"interval": "35",
- "legendFormat": "netSendTraffic",
+ "intervalFactor": 1,
+ "legendFormat": "wBPS",
"range": true,
- "refId": "B"
+ "refId": "B",
+ "step": 240
}
],
- "title": "Mysql网络吞吐",
+ "title": "MySQL IO\u541e\u5410",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
- "description": "",
+ "description": "mysql\u5b9e\u4f8b\u4ea7\u751f\u7684\u810f\u9875\u91cf\u4ee5\u53ca\u810f\u9875\u6c34\u4f4d\uff0c\u4e00\u822c\u5730\uff0c\u5f53\u810f\u9875\u91cf\u8d85\u8fc7\u810f\u9875\u6c34\u4f4d\u65f6\uff0c\u4f1a\u5bfc\u81f4mysql\u5199Buffer IO\u963b\u585e",
"fieldConfig": {
"defaults": {
"color": {
@@ -2692,6 +2998,7 @@
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
+ "axisSoftMax": 4,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
@@ -2702,11 +3009,8 @@
"viz": false
},
"lineInterpolation": "smooth",
- "lineStyle": {
- "fill": "solid"
- },
"lineWidth": 1,
- "pointSize": 5,
+ "pointSize": 2,
"scaleDistribution": {
"type": "linear"
},
@@ -2729,7 +3033,7 @@
}
]
},
- "unit": "none"
+ "unit": "bytes"
},
"overrides": []
},
@@ -2737,18 +3041,24 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 55
+ "y": 64
},
- "id": 48,
+ "id": 56,
"options": {
"legend": {
- "calcs": [],
- "displayMode": "list",
+ "calcs": [
+ "min",
+ "mean",
+ "max",
+ "lastNotNull"
+ ],
+ "displayMode": "table",
"placement": "bottom",
- "showLegend": true
+ "showLegend": true,
+ "width": 0
},
"tooltip": {
- "mode": "single",
+ "mode": "multi",
"sort": "none"
}
},
@@ -2757,20 +3067,40 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"requestCount\"}",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"cgroupDirtyPages\"}",
"hide": false,
"interval": "35",
- "legendFormat": "mysql requestCnt",
+ "legendFormat": "Dirty Pages",
"range": true,
"refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"cgroupDirtyBlockThresh\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "Dirty Thresh",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",mode=\"cgroupFlushPages\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "Flush Pages",
+ "range": true,
+ "refId": "C"
}
],
- "title": "Mysql请求数",
+ "title": "MySQL OS\u810f\u9875\u91cf",
"type": "timeseries"
},
{
"datasource": "sysom-prometheus",
- "description": "The number of bytes read from or written to the device per second",
+ "description": "",
"fieldConfig": {
"defaults": {
"color": {
@@ -2779,11 +3109,12 @@
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
- "axisLabel": "bytes read (-) / write (+)",
+ "axisLabel": "",
"axisPlacement": "auto",
+ "axisSoftMax": 4,
"barAlignment": 0,
"drawStyle": "line",
- "fillOpacity": 20,
+ "fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
@@ -2806,17 +3137,12 @@
"mode": "off"
}
},
- "links": [],
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
- },
- {
- "color": "red",
- "value": 80
}
]
},
@@ -2828,55 +3154,51 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 63
+ "y": 72
},
- "id": 20,
- "links": [],
+ "id": 47,
"options": {
"legend": {
"calcs": [
+ "min",
"mean",
- "lastNotNull",
"max",
- "min"
+ "lastNotNull"
],
"displayMode": "table",
"placement": "bottom",
- "showLegend": true
+ "showLegend": true,
+ "width": 0
},
"tooltip": {
"mode": "multi",
- "sort": "none"
+ "sort": "desc"
}
},
- "pluginVersion": "9.2.0",
+ "pluginVersion": "9.2.2",
"targets": [
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"ioReadBps\"}",
- "format": "time_series",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"netRecTraffic\"}",
+ "hide": false,
"interval": "35",
- "intervalFactor": 4,
- "legendFormat": "rBPS",
+ "legendFormat": "netRecTraffic",
"range": true,
- "refId": "A",
- "step": 240
+ "refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"ioWriteBps\"}",
- "format": "time_series",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"netSendTraffic\"}",
+ "hide": false,
"interval": "35",
- "intervalFactor": 1,
- "legendFormat": "wBPS",
+ "legendFormat": "netSendTraffic",
"range": true,
- "refId": "B",
- "step": 240
+ "refId": "B"
}
],
- "title": "Mysql IO吞吐",
+ "title": "MySQL\u7f51\u7edc\u541e\u5410",
"type": "timeseries"
},
{
@@ -2892,7 +3214,6 @@
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
- "axisSoftMax": 4,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
@@ -2903,8 +3224,11 @@
"viz": false
},
"lineInterpolation": "smooth",
+ "lineStyle": {
+ "fill": "solid"
+ },
"lineWidth": 1,
- "pointSize": 2,
+ "pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
@@ -2927,7 +3251,7 @@
}
]
},
- "unit": "bytes"
+ "unit": "none"
},
"overrides": []
},
@@ -2935,24 +3259,18 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 63
+ "y": 72
},
- "id": 56,
+ "id": 48,
"options": {
"legend": {
- "calcs": [
- "min",
- "mean",
- "max",
- "lastNotNull"
- ],
- "displayMode": "table",
+ "calcs": [],
+ "displayMode": "list",
"placement": "bottom",
- "showLegend": true,
- "width": 0
+ "showLegend": true
},
"tooltip": {
- "mode": "multi",
+ "mode": "single",
"sort": "none"
}
},
@@ -2961,35 +3279,15 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"cgroupDirtyPages\"}",
+ "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\", value=\"requestCount\"}",
"hide": false,
"interval": "35",
- "legendFormat": "Dirty Pages",
+ "legendFormat": "mysql requestCnt",
"range": true,
"refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",value=\"cgroupDirtyBlockThresh\"}",
- "hide": false,
- "interval": "35",
- "legendFormat": "Dirty Thresh",
- "range": true,
- "refId": "B"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_obser_mysqld_process{containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\",mode=\"cgroupFlushPages\"}",
- "hide": false,
- "interval": "35",
- "legendFormat": "Flush Pages",
- "range": true,
- "refId": "C"
}
],
- "title": "Mysql OS脏页量",
+ "title": "MySQL\u8bf7\u6c42\u6570",
"type": "timeseries"
}
],
@@ -3002,8 +3300,8 @@
{
"current": {
"selected": false,
- "text": "${podId}",
- "value": "${podId}"
+ "text": "db0a32b0_7632_44c0_975a_f3bfc5b6c55e",
+ "value": "db0a32b0_7632_44c0_975a_f3bfc5b6c55e"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process, podID)",
@@ -3025,8 +3323,8 @@
{
"current": {
"selected": false,
- "text": "88202520f395",
- "value": "88202520f395"
+ "text": "bcf1a8a097d5",
+ "value": "bcf1a8a097d5"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\"}, containerID)",
@@ -3047,10 +3345,9 @@
},
{
"current": {
- "isNone": true,
"selected": false,
- "text": "None",
- "value": ""
+ "text": "192.168.0.136",
+ "value": "192.168.0.136"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\"}, exported_instance)",
@@ -3071,10 +3368,9 @@
},
{
"current": {
- "isNone": true,
"selected": false,
- "text": "None",
- "value": ""
+ "text": "3306",
+ "value": "3306"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIP\"}, port)",
@@ -3095,10 +3391,9 @@
},
{
"current": {
- "isNone": true,
"selected": false,
- "text": "None",
- "value": ""
+ "text": "4411",
+ "value": "4411"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIP\",port=\"$Port\"}, pid)",
@@ -3119,20 +3414,50 @@
},
{
"current": {
- "isNone": true,
- "selected": false,
- "text": "None",
- "value": ""
+ "selected": true,
+ "text": [
+ "None"
+ ],
+ "value": [
+ ""
+ ]
},
"datasource": "sysom-prometheus",
- "definition": "label_values(sysom_obser_app_rt_ntopo{PodUUID=\"$podId\"}, Pod)",
- "hide": 0,
+ "definition": "label_values(sysom_ntopo_node{PodUUID=\"$podId\"}, Pod)",
+ "hide": 2,
"includeAll": false,
"multi": true,
"name": "podname",
"options": [],
"query": {
- "query": "label_values(sysom_obser_app_rt_ntopo{PodUUID=\"$podId\"}, Pod)",
+ "query": "label_values(sysom_ntopo_node{PodUUID=\"$podId\"}, Pod)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "selected": true,
+ "text": [
+ "All"
+ ],
+ "value": [
+ "$__all"
+ ]
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_iolatency{ppid=\"$Pid\"}, diskname)",
+ "hide": 2,
+ "includeAll": true,
+ "multi": true,
+ "name": "Disk_list",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_iolatency{ppid=\"$Pid\"}, diskname)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
@@ -3144,7 +3469,7 @@
]
},
"time": {
- "from": "now-15m",
+ "from": "now-1h",
"to": "now"
},
"timepicker": {
@@ -3163,9 +3488,9 @@
]
},
"timezone": "",
- "title": "app-mysql",
+ "title": "app-mysql-server",
"uid": "hOk70b34k",
- "version": 15,
+ "version": 317,
"weekStart": ""
}
}
\ No newline at end of file
diff --git a/deps/4_grafana/sysom-appobserver-mysql-events-dashboard.json b/deps/4_grafana/sysom-appobserver-mysql-events-dashboard.json
index db2538b1..9dd86965 100644
--- a/deps/4_grafana/sysom-appobserver-mysql-events-dashboard.json
+++ b/deps/4_grafana/sysom-appobserver-mysql-events-dashboard.json
@@ -43,8 +43,7 @@
"mode": "absolute",
"steps": [
{
- "color": "semi-dark-red",
- "value": null
+ "color": "semi-dark-red"
},
{
"color": "red",
@@ -105,7 +104,7 @@
"value": [
{
"options": {
- "无": {
+ "\u65e0": {
"color": "text",
"index": 0
}
@@ -124,7 +123,7 @@
{
"targetBlank": true,
"title": "",
- "url": "../${__data.fields.root_analyz_flag}instance=${__data.fields.instance}"
+ "url": "../${__data.fields.root_analyz_flag}\ufeff\ufeff\ufeff\ufeffinstance=${__data.fields.instance}"
}
]
}
@@ -174,7 +173,7 @@
"properties": [
{
"id": "custom.width",
- "value": 132
+ "value": 371
}
]
},
@@ -205,6 +204,18 @@
"value": 410
}
]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "port"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 71
+ }
+ ]
}
]
},
@@ -236,7 +247,7 @@
"format": "table",
"hide": false,
"rawQuery": true,
- "rawSql": "SELECT extra, instance,\n CASE \n WHEN JSON_EXTRACT(extra, '$.root_analyz_flag') = 'journal/node?'\n THEN '无'\n ELSE '进一步诊断'\n END AS root_analyze\nFROM sysom.sys_node_log\nWHERE (JSON_EXTRACT(extra, '$.podId') = \"$podId\" OR JSON_EXTRACT(extra, '$.containerId') = \"$containerId\") AND instance = \"$hostIp\" AND UNIX_TIMESTAMP(create_at) > $__from / 1000 AND UNIX_TIMESTAMP(create_at) < $__to / 1000 AND JSON_EXTRACT(extra, '$.reason') IS NOT NULL AND JSON_EXTRACT(extra, '$.tag_set') = 'mysqld' \nORDER BY ts DESC LIMIT 20\n",
+ "rawSql": "SELECT annotations, instance,\n CASE \n WHEN JSON_EXTRACT(annotations, '$.root_analyz_flag') = 'journal/node?'\n THEN '\u65e0'\n ELSE '\u8fdb\u4e00\u6b65\u8bca\u65ad'\n END AS root_analyze\nFROM sysom.sys_alert_data\nWHERE (JSON_EXTRACT(annotations, '$.podId') = \"$podId\" OR JSON_EXTRACT(annotations, '$.containerId') = \"$containerId\") AND alert_time > $__from AND alert_time < $__to AND JSON_EXTRACT(annotations, '$.reason') IS NOT NULL AND JSON_EXTRACT(annotations, '$.tag_set') = 'mysqld' \nORDER BY alert_time DESC LIMIT 20\n",
"refId": "A",
"sql": {
"columns": [
@@ -263,7 +274,7 @@
"table": "sys_node_log"
}
],
- "title": "Mysql应用相关异常事件",
+ "title": "Mysql\u5e94\u7528\u76f8\u5173\u5f02\u5e38\u4e8b\u4ef6",
"transformations": [
{
"disabled": true,
@@ -310,7 +321,7 @@
"options": {
"format": "json",
"replace": false,
- "source": "extra"
+ "source": "annotations"
}
},
{
@@ -353,6 +364,7 @@
"id": "organize",
"options": {
"excludeByName": {
+ "annotations": true,
"app_log": true,
"containerId": true,
"curr": true,
@@ -370,18 +382,19 @@
"unit": true
},
"indexByName": {
- "app_log": 8,
+ "app_log": 9,
"containerId": 7,
- "extra": 11,
- "instance": 12,
+ "extra": 12,
+ "instance": 13,
+ "level": 8,
"metrics": 4,
- "os_log": 10,
+ "os_log": 11,
"pid": 6,
"podId": 1,
"port": 2,
- "reason": 9,
- "root_analyz_flag": 14,
- "root_analyze": 13,
+ "reason": 10,
+ "root_analyz_flag": 15,
+ "root_analyze": 14,
"tag_set": 5,
"ts": 0,
"value": 3
@@ -425,8 +438,7 @@
"mode": "absolute",
"steps": [
{
- "color": "semi-dark-red",
- "value": null
+ "color": "semi-dark-red"
},
{
"color": "red",
@@ -579,13 +591,13 @@
"value": [
{
"targetBlank": true,
- "title": "根因诊断",
+ "title": "\u6839\u56e0\u8bca\u65ad",
"url": "../${__data.fields.root_analyz_flag}instance=${__data.fields.instance}"
},
{
"targetBlank": true,
- "title": "指标关联分析",
- "url": "../api/v1/rca/rca_call?timestamp=${__data.fields.ts}&base_item=${__data.fields.metrics}&machine_ip=${__data.fields.instance}"
+ "title": "\u6307\u6807\u5173\u8054\u5206\u6790",
+ "url": "../api/v1/rca/rca_call?timestamp=${__data.fields.ts}\ufeff&base_item=${__data.fields.metrics}&machine_ip=${__data.fields.instance}"
}
]
},
@@ -600,7 +612,7 @@
"options": {
"responseTimeAvg": {
"index": 0,
- "text": "进一步诊断"
+ "text": "\u8fdb\u4e00\u6b65\u8bca\u65ad"
}
},
"type": "value"
@@ -648,7 +660,7 @@
{
"matcher": {
"id": "byName",
- "options": "extra"
+ "options": "annotations"
},
"properties": [
{
@@ -765,7 +777,7 @@
"properties": [
{
"id": "custom.width",
- "value": 361
+ "value": 373
}
]
},
@@ -792,6 +804,18 @@
"value": true
}
]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "port"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 89
+ }
+ ]
}
]
},
@@ -823,7 +847,7 @@
"format": "table",
"hide": false,
"rawQuery": true,
- "rawSql": "SELECT *, '进一步诊断' as 'root cause analyze' FROM sysom.sys_node_log \nWHERE UNIX_TIMESTAMP(create_at) > (\n SELECT COALESCE(MAX(UNIX_TIMESTAMP(create_at)), '0000-00-00 00:00:00')\n FROM sysom.sys_node_log \n WHERE (JSON_EXTRACT(extra, '$.podId') = \"$podId\" OR JSON_EXTRACT(extra, '$.containerId') = \"$containerId\" AND instance = \"$hostIp\" ) \n AND UNIX_TIMESTAMP(create_at) > $__from / 1000 \n AND UNIX_TIMESTAMP(create_at) < $__to / 1000 \n AND JSON_EXTRACT(extra, '$.reason') IS NOT NULL \n AND JSON_EXTRACT(extra, '$.tag_set') = 'mysqld'\n)\nAND UNIX_TIMESTAMP(create_at) > $__from / 1000 \nAND UNIX_TIMESTAMP(create_at) < $__to / 1000 \nAND JSON_EXTRACT(extra, '$.tag_set') = 'mysqld'\nAND JSON_EXTRACT(extra, '$.app_log') IS NULL\nAND (JSON_EXTRACT(extra, '$.podId') = \"$podId\" OR JSON_EXTRACT(extra, '$.containerId') = \"$containerId\" AND instance = \"$hostIp\")\nORDER BY ts DESC \nLIMIT 20",
+ "rawSql": "SELECT alert_time, annotations, instance, '\u8fdb\u4e00\u6b65\u8bca\u65ad' as 'root cause analyze' FROM sysom.sys_alert_data \nWHERE alert_time > (\n SELECT COALESCE(MAX(alert_time / 1000), '0000-00-00 00:00:00') \n FROM sysom.sys_alert_data \n WHERE (JSON_EXTRACT(annotations, '$.podId') = \"$podId\" OR JSON_EXTRACT(annotations, '$.containerId') = \"$containerId\") \n AND alert_time > $__from \n AND alert_time < $__to\n AND JSON_EXTRACT(annotations, '$.reason') IS NOT NULL \n AND JSON_EXTRACT(annotations, '$.tag_set') = 'mysqld'\n)\nAND alert_time > $__from\nAND alert_time < $__to\nAND (JSON_EXTRACT(annotations, '$.tag_set') = 'mysqld' OR JSON_EXTRACT(annotations, '$.value') LIKE '%mysqld%')\nAND JSON_EXTRACT(annotations, '$.app_log') IS NULL\nAND (JSON_EXTRACT(annotations, '$.podId') = \"$podId\" OR JSON_EXTRACT(annotations, '$.containerId') = \"$containerId\" OR JSON_EXTRACT(annotations, '$.value') LIKE '%$Pid%')\nORDER BY alert_time DESC \nLIMIT 20",
"refId": "A",
"sql": {
"columns": [
@@ -850,12 +874,13 @@
"table": "sys_node_log"
}
],
- "title": "Mysql OS相关异常事件",
+ "title": "Mysql OS\u76f8\u5173\u5f02\u5e38\u4e8b\u4ef6",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
+ "alert_time": true,
"app_log": true,
"containerId": true,
"create_at": true,
@@ -868,6 +893,7 @@
"os_log": true,
"pid": false,
"reason": true,
+ "root cause analyze": false,
"tag_set": false,
"ts": true,
"unit": true,
@@ -899,7 +925,7 @@
"options": {
"format": "json",
"replace": false,
- "source": "extra"
+ "source": "annotations"
}
},
{
@@ -966,23 +992,18 @@
"value": false
},
"indexByName": {
- "app_log": 11,
- "containerId": 9,
- "curr": 15,
- "disk": 14,
- "extra": 4,
+ "annotations": 10,
+ "containerId": 7,
+ "details": 12,
"instance": 1,
- "level": 10,
- "metrics": 7,
- "os_log": 13,
- "pid": 3,
+ "level": 8,
+ "pid": 4,
"podId": 2,
- "reason": 12,
- "root cause analyze": 17,
- "tag_set": 8,
- "thresh": 16,
+ "port": 3,
+ "root cause analyze": 9,
+ "root_analyz_flag": 11,
+ "tag_set": 6,
"ts": 0,
- "unit": 6,
"value": 5
},
"renameByName": {}
@@ -1004,7 +1025,7 @@
"type": "table"
}
],
- "refresh": "5s",
+ "refresh": "15s",
"schemaVersion": 37,
"style": "dark",
"tags": [],
@@ -1013,8 +1034,8 @@
{
"current": {
"selected": false,
- "text": "NULL",
- "value": "NULL"
+ "text": "36ec6dca_b5da_4b3b_b693_b6dbe4b8a9a6",
+ "value": "36ec6dca_b5da_4b3b_b693_b6dbe4b8a9a6"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process, podID)",
@@ -1036,8 +1057,8 @@
{
"current": {
"selected": false,
- "text": "88202520f395",
- "value": "88202520f395"
+ "text": "a83df925aa86",
+ "value": "a83df925aa86"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\"}, containerID)",
@@ -1059,18 +1080,18 @@
{
"current": {
"selected": false,
- "text": "192.168.0.6",
- "value": "192.168.0.6"
+ "text": "192.168.0.138",
+ "value": "192.168.0.138"
},
"datasource": "sysom-prometheus",
- "definition": "label_values(sysom_obser_mysqld_process{containerID=\"$containerId\"}, exported_instance)",
+ "definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\"}, exported_instance)",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "hostIp",
"options": [],
"query": {
- "query": "label_values(sysom_obser_mysqld_process{containerID=\"$containerId\"}, exported_instance)",
+ "query": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\"}, exported_instance)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
@@ -1081,6 +1102,53 @@
},
{
"current": {
+ "selected": false,
+ "text": "3306",
+ "value": "3306"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIp\"}, port)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "Port",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIp\"}, port)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "selected": false,
+ "text": "4110",
+ "value": "4110"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIp\",port=\"$Port\"}, pid)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "Pid",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_obser_mysqld_process{podID=\"$podId\",containerID=\"$containerId\",exported_instance=\"$hostIp\",port=\"$Port\"}, pid)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "isNone": true,
"selected": false,
"text": "None",
"value": ""
@@ -1105,14 +1173,28 @@
]
},
"time": {
- "from": "now-15m",
+ "from": "now-30m",
"to": "now"
},
- "timepicker": {},
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "15s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ]
+ },
"timezone": "",
"title": "app-mysql-events",
"uid": "Ub__1x3Vz",
- "version": 4,
+ "version": 107,
"weekStart": ""
}
}
\ No newline at end of file
--
Gitee
From f04bbdde3169409db0a7cbb4c2d129dc9ba0f996 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Thu, 14 Dec 2023 14:18:43 +0800
Subject: [PATCH 026/176] feat(diagnosis): Support preprocess-post-wrapper
---
.../sysom_diagnosis/apps/task/executor.py | 39 +++++----
.../sysom_diagnosis/apps/task/helper.py | 79 +++++++++++++++++--
.../service_scripts/__init__.py | 0
.../service_scripts/wrapper/__init__.py | 0
.../service_scripts/wrapper/base.py | 8 ++
.../service_scripts/wrapper/dummy.py | 12 +++
6 files changed, 114 insertions(+), 24 deletions(-)
create mode 100644 sysom_server/sysom_diagnosis/service_scripts/__init__.py
create mode 100644 sysom_server/sysom_diagnosis/service_scripts/wrapper/__init__.py
create mode 100644 sysom_server/sysom_diagnosis/service_scripts/wrapper/base.py
create mode 100644 sysom_server/sysom_diagnosis/service_scripts/wrapper/dummy.py
diff --git a/sysom_server/sysom_diagnosis/apps/task/executor.py b/sysom_server/sysom_diagnosis/apps/task/executor.py
index f06338d8..a912c801 100644
--- a/sysom_server/sysom_diagnosis/apps/task/executor.py
+++ b/sysom_server/sysom_diagnosis/apps/task/executor.py
@@ -61,24 +61,29 @@ class DiagnosisTaskExecutor(AsyncEventExecutor):
# 1. Preprocess
res = await DiagnosisHelper.preprocess_async(instance)
+ if not res:
+ raise Exception("Diagnosis preprocess error, DiagnosisTask is None")
+
+ # 1.1 Preprocess post wrapper
+ await DiagnosisHelper.preprocess_post_wrapper_async(instance, res)
+
# 2. Execute and Postprocess
- if res:
- if not res.offline_mode:
- job_result = await DiagnosisHelper.execute_async(instance, res)
- else:
- job_result = DiagnosisTaskResult(
- 0,
- job_results=[
- DiagnosisJobResult(
- 0,
- stdout=item,
- job=res.jobs[idx] if len(res.jobs) > idx else None,
- )
- for idx, item in enumerate(res.offline_results)
- ],
- in_order=res.in_order,
- )
- await DiagnosisHelper.postprocess_async(instance, job_result)
+ if not res.offline_mode:
+ job_result = await DiagnosisHelper.execute_async(instance, res)
+ else:
+ job_result = DiagnosisTaskResult(
+ 0,
+ job_results=[
+ DiagnosisJobResult(
+ 0,
+ stdout=item,
+ job=res.jobs[idx] if len(res.jobs) > idx else None,
+ )
+ for idx, item in enumerate(res.offline_results)
+ ],
+ in_order=res.in_order,
+ )
+ await DiagnosisHelper.postprocess_async(instance, job_result)
# 3. TODO: produce task execute result to cec
diff --git a/sysom_server/sysom_diagnosis/apps/task/helper.py b/sysom_server/sysom_diagnosis/apps/task/helper.py
index b96f0df5..024e85d5 100644
--- a/sysom_server/sysom_diagnosis/apps/task/helper.py
+++ b/sysom_server/sysom_diagnosis/apps/task/helper.py
@@ -21,6 +21,7 @@ from service_scripts.base import (
PostProcessResult,
DiagnosisPostProcessor,
)
+from service_scripts.wrapper.base import DiagnosisPreProcessorPostWrapperBase
class DiagnosisHelper:
@@ -93,7 +94,9 @@ class DiagnosisHelper:
}
@staticmethod
- def preprocess(instance: JobModel, ignore_check: bool = False) -> Optional[DiagnosisTask]:
+ def preprocess(
+ instance: JobModel, ignore_check: bool = False
+ ) -> Optional[DiagnosisTask]:
""" "Perform diagnosis preprocessing
{
"commands":[
@@ -159,7 +162,9 @@ class DiagnosisHelper:
return DiagnosisHelper.run_subprocess(cmd)
@staticmethod
- async def preprocess_v1_async(instance: JobModel, ignore_check: bool = False) -> DiagnosisTask:
+ async def preprocess_v1_async(
+ instance: JobModel, ignore_check: bool = False
+ ) -> DiagnosisTask:
""" "Perform diagnosis preprocessing
{
@@ -219,7 +224,9 @@ class DiagnosisHelper:
return diagnosis_task
@staticmethod
- async def preprocess_v2_async(instance: JobModel, ignore_check: bool = False) -> Optional[DiagnosisTask]:
+ async def preprocess_v2_async(
+ instance: JobModel, ignore_check: bool = False
+ ) -> Optional[DiagnosisTask]:
"""Pre-processing V2
Args:
@@ -287,7 +294,9 @@ class DiagnosisHelper:
return diagnosis_task
@staticmethod
- async def preprocess_async(instance: JobModel, ignore_check: bool = False) -> Optional[DiagnosisTask]:
+ async def preprocess_async(
+ instance: JobModel, ignore_check: bool = False
+ ) -> Optional[DiagnosisTask]:
""" "Perform diagnosis preprocessing
{
"commands":[
@@ -303,9 +312,13 @@ class DiagnosisHelper:
"""
diagnosis_task: Optional[DiagnosisTask] = None
try:
- diagnosis_task = await DiagnosisHelper.preprocess_v2_async(instance, ignore_check)
+ diagnosis_task = await DiagnosisHelper.preprocess_v2_async(
+ instance, ignore_check
+ )
if diagnosis_task is None:
- diagnosis_task = await DiagnosisHelper.preprocess_v1_async(instance, ignore_check)
+ diagnosis_task = await DiagnosisHelper.preprocess_v1_async(
+ instance, ignore_check
+ )
# If the pre-processor executes successfully, the parameters are compliant
# and the Job instance is updated
@@ -323,6 +336,56 @@ class DiagnosisHelper:
)
return diagnosis_task
+ @staticmethod
+ async def preprocess_post_wrapper_async(
+ instance: JobModel, diagnosis_task: DiagnosisTask
+ ) -> DiagnosisTask:
+ """Preprocess post wrapper
+
+ Args:
+ diagnosis_task (DiagnosisTask): Diagnosis task
+ wrapper (Type[DiagnosisPreProcessor]): Diagnosis preprocessor post wrapper
+ """
+
+ def _get_pre_processor_post_wrapper(
+ wrapper_type: str,
+ ) -> Type[DiagnosisPreProcessorPostWrapperBase]:
+ try:
+ return import_module(
+ f"service_scripts.wrapper.{wrapper_type}"
+ ).DiagnosisPreProcessorPostWrapper
+ except Exception as e:
+ raise Exception(f"No Pre-processor-post-wrapper available => {str(e)}")
+
+ try:
+ # 1. Get params
+ params = instance.params.copy()
+ if isinstance(instance.params, str):
+ try:
+ params = json.loads(instance.params)
+ except Exception as exc:
+ raise Exception(f"Task params loads error: {str(exc)}")
+ if "sysom_preprocess_post_wrapper" not in params:
+ return diagnosis_task
+
+ preprocess_post_wrapper = params.pop("sysom_preprocess_post_wrapper")
+ wrapper = _get_pre_processor_post_wrapper(preprocess_post_wrapper)()
+ wrapper.process(instance.task_id, diagnosis_task)
+ await DiagnosisHelper._update_job_async(
+ instance, command=diagnosis_task.to_dict()
+ )
+ except Exception as exc:
+ logger.exception(f"Diagnosis preprocess post wrapper error: {str(exc)}")
+ await DiagnosisHelper._update_job_async(
+ instance,
+ result="Diagnosis preprocess post wrapper error",
+ status="Fail",
+ code=1,
+ err_msg=f"Diagnosis preprocess post wrapper error: {str(exc)}",
+ )
+
+ return diagnosis_task
+
@staticmethod
async def execute_async(
instance: JobModel, diagnosis_task: DiagnosisTask
@@ -436,7 +499,9 @@ class DiagnosisHelper:
with tempfile.NamedTemporaryFile(mode="w") as tmp_file:
try:
# 将要传递的中间结果写入到临时文件当中
- tmp_file.write("".join([item.stdout for item in diagnosis_task_result.job_results]))
+ tmp_file.write(
+ "".join([item.stdout for item in diagnosis_task_result.job_results])
+ )
tmp_file.flush()
resp = await DiagnosisHelper.run_subprocess_async(
[service_post_path, tmp_file.name, instance.task_id]
diff --git a/sysom_server/sysom_diagnosis/service_scripts/__init__.py b/sysom_server/sysom_diagnosis/service_scripts/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/sysom_server/sysom_diagnosis/service_scripts/wrapper/__init__.py b/sysom_server/sysom_diagnosis/service_scripts/wrapper/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/sysom_server/sysom_diagnosis/service_scripts/wrapper/base.py b/sysom_server/sysom_diagnosis/service_scripts/wrapper/base.py
new file mode 100644
index 00000000..f6e62ed3
--- /dev/null
+++ b/sysom_server/sysom_diagnosis/service_scripts/wrapper/base.py
@@ -0,0 +1,8 @@
+from service_scripts.base import DiagnosisTask
+
+
+class DiagnosisPreProcessorPostWrapperBase:
+ """诊断前处理后包装器,用于在诊断前处理后对前处理的结果进行统一加工,比如给命令加上 wrapper 等
+ """
+ def process(self, task_id: str, diagnosis_task: DiagnosisTask):
+ pass
diff --git a/sysom_server/sysom_diagnosis/service_scripts/wrapper/dummy.py b/sysom_server/sysom_diagnosis/service_scripts/wrapper/dummy.py
new file mode 100644
index 00000000..b309645f
--- /dev/null
+++ b/sysom_server/sysom_diagnosis/service_scripts/wrapper/dummy.py
@@ -0,0 +1,12 @@
+from service_scripts.base import DiagnosisTask
+from .base import DiagnosisPreProcessorPostWrapperBase
+
+class DiagnosisPreProcessorPostWrapper(DiagnosisPreProcessorPostWrapperBase):
+ """所有命令的执行结果导出到临时文件并cat出来
+
+ Args:
+ DiagnosisPreProcessorPostWrapperBase (_type_): _description_
+ """
+ def process(self, task_id: str, diagnosis_task: DiagnosisTask):
+ for job in diagnosis_task.jobs:
+ job.cmd = f"({job.cmd}) > /tmp/{job.instance}.txt && cat /tmp/{job.instance}.txt"
\ No newline at end of file
--
Gitee
From 390f18c69ddf26dfdc749aa5d0cc64551794f873 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=88=92=E4=B9=89?=
Date: Thu, 14 Dec 2023 11:07:19 +0800
Subject: [PATCH 027/176] feat: add nginx observability dashboard json
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 舒义
---
deps/4_grafana/grafana_api_set.sh | 18 +
.../sysom-appobserver-nginx-dashboard.json | 1088 +++++++++++++++++
...om-appobserver-nginx-events-dashboard.json | 452 +++++++
3 files changed, 1558 insertions(+)
create mode 100644 deps/4_grafana/sysom-appobserver-nginx-dashboard.json
create mode 100644 deps/4_grafana/sysom-appobserver-nginx-events-dashboard.json
diff --git a/deps/4_grafana/grafana_api_set.sh b/deps/4_grafana/grafana_api_set.sh
index cd9efef7..c3a93083 100755
--- a/deps/4_grafana/grafana_api_set.sh
+++ b/deps/4_grafana/grafana_api_set.sh
@@ -156,6 +156,24 @@ then
exit 1
fi
+curl -c cookie -b cookie --location --request POST 'http://127.0.0.1:3000/api/dashboards/db' \
+--header 'Content-Type: application/json' \
+-d @"sysom-appobserver-nginx-dashboard.json"
+if [ $? -ne 0 ]
+then
+ echo "grafana configure sysom-appobserver-nginx-dashboard error"
+ exit 1
+fi
+
+curl -c cookie -b cookie --location --request POST 'http://127.0.0.1:3000/api/dashboards/db' \
+--header 'Content-Type: application/json' \
+-d @"sysom-appobserver-nginx-events-dashboard.json"
+if [ $? -ne 0 ]
+then
+ echo "grafana configure sysom-appobserver-nginx-events-dashboard error"
+ exit 1
+fi
+
curl -c cookie -b cookie --location --request POST 'http://127.0.0.1:3000/api/dashboards/db' \
--header 'Content-Type: application/json' \
-d @"sysom-appobserver-process-dashboard.json"
diff --git a/deps/4_grafana/sysom-appobserver-nginx-dashboard.json b/deps/4_grafana/sysom-appobserver-nginx-dashboard.json
new file mode 100644
index 00000000..78b411be
--- /dev/null
+++ b/deps/4_grafana/sysom-appobserver-nginx-dashboard.json
@@ -0,0 +1,1088 @@
+{
+ "dashboard": {
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": false,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 0,
+ "id": null,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 8,
+ "panels": [],
+ "title": "\u5f02\u5e38\u4e8b\u4ef6",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx\u670d\u52a1\u5728OS\u4e2d\u88ab\u89c2\u6d4b\u5230\u53ef\u80fd\u5b58\u5728\u7684\u5f02\u5e38\u544a\u8b66\u4e8b\u4ef6\u7edf\u8ba1\u4fe1\u606f",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "links": [],
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 1
+ }
+ ]
+ }
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "\u8bf7\u6c42\u6296\u52a8"
+ },
+ "properties": [
+ {
+ "id": "links",
+ "value": [
+ {
+ "targetBlank": false,
+ "title": "",
+ "url": "../grafana/d/HtuWUeSSz/nginx-event?var-instance=${instance}&var-masterPid=${masterPid}"
+ }
+ ]
+ },
+ {
+ "id": "unit",
+ "value": "none"
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "\u8bf7\u6c424xx"
+ },
+ "properties": [
+ {
+ "id": "links",
+ "value": [
+ {
+ "title": "",
+ "url": "../grafana/d/HtuWUeSSz/nginx-event?var-instance=${instance}&var-masterPid=${masterPid}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "\u8bf7\u6c425xx"
+ },
+ "properties": [
+ {
+ "id": "links",
+ "value": [
+ {
+ "title": "",
+ "url": "../grafana/d/HtuWUeSSz/nginx-event?var-instance=${instance}&var-masterPid=${masterPid}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "\u9519\u8bef\u65e5\u5fd7"
+ },
+ "properties": [
+ {
+ "id": "links",
+ "value": [
+ {
+ "title": "",
+ "url": "../grafana/d/HtuWUeSSz/nginx-event?var-instance=${instance}&var-masterPid=${masterPid}"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 24,
+ "x": 0,
+ "y": 1
+ },
+ "id": 18,
+ "links": [],
+ "options": {
+ "displayMode": "gradient",
+ "minVizHeight": 10,
+ "minVizWidth": 0,
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showUnfilled": true
+ },
+ "pluginVersion": "9.2.2",
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "round(sum(increase(sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"requestJitter\"}[$__range])))",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "\u8bf7\u6c42\u6296\u52a8",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "round(sum(increase(sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_4xx\"}[$__range])))",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "\u8bf7\u6c424xx",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "round(sum(increase(sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_5xx\"}[$__range])))",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "\u8bf7\u6c425xx",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"errorLog\"}",
+ "hide": false,
+ "legendFormat": "\u9519\u8bef\u65e5\u5fd7",
+ "range": true,
+ "refId": "D"
+ }
+ ],
+ "title": "\u5f02\u5e38\u544a\u8b66\u5206\u5e03\uff08\u6b21\u6570\uff09",
+ "type": "bargauge"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 7
+ },
+ "id": 6,
+ "panels": [],
+ "title": "\u5e94\u7528\u6307\u6807",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx\u7684\u8bf7\u6c42\u6570",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 8
+ },
+ "id": 9,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"requests\"}",
+ "interval": "35",
+ "legendFormat": "requests",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "\u8bf7\u6c42\u6570",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "http\u8bf7\u6c42\u7684status\u5206\u5e03\u60c5\u51b5",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 8
+ },
+ "id": 14,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_1xx\"}",
+ "interval": "35",
+ "legendFormat": "status_1xx",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_2xx\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "status_2xx",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_3xx\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "status_3xx",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_4xx\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "status_4xx",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"status_5xx\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "status_5xx",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "http status\u5206\u5e03",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "\u54cd\u5e94\u65f6\u5ef6\uff0c\u5305\u62ecrequest\u548cupstream",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "ms"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 16
+ },
+ "id": 15,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"requestTimeAvg\"}",
+ "interval": "35",
+ "legendFormat": "requestTime",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"upstreamTimeAvg\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "upstreamTime",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"maxRequestTime\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "maxRequestTime",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"maxUpstreamTime\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "maxUpstreamTime",
+ "range": true,
+ "refId": "D"
+ }
+ ],
+ "title": "\u54cd\u5e94\u65f6\u5ef6",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx workers\u7684\u6570\u91cf",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 16
+ },
+ "id": 13,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"workersCount\"}",
+ "interval": "35",
+ "legendFormat": "workersCount",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "workers\u6570\u91cf",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx\u5f53\u524d\u6d3b\u8dc3\u7684\u8fde\u63a5\u6570",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": [
+ {
+ "__systemRef": "hideSeriesFrom",
+ "matcher": {
+ "id": "byNames",
+ "options": {
+ "mode": "exclude",
+ "names": [
+ "activeConnections"
+ ],
+ "prefix": "All except:",
+ "readOnly": true
+ }
+ },
+ "properties": [
+ {
+ "id": "custom.hideFrom",
+ "value": {
+ "legend": false,
+ "tooltip": false,
+ "viz": true
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 24,
+ "x": 0,
+ "y": 24
+ },
+ "id": 12,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"activeConnections\"}",
+ "interval": "35",
+ "legendFormat": "activeConnections",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "\u6d3b\u8dc3\u7684\u8fde\u63a5\u6570",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 32
+ },
+ "id": 4,
+ "panels": [],
+ "title": "\u7cfb\u7edf\u6307\u6807",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx\u7684cpu\u5229\u7528\u7387",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 33
+ },
+ "id": 2,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_worker_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"cpuTot\"}",
+ "interval": "35",
+ "legendFormat": "{{pid}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "nginx\u8fdb\u7a0bcpu\u5229\u7528\u7387",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "nginx\u7684\u5185\u5b58\u5229\u7528\u7387",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 33
+ },
+ "id": 10,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_worker_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"memPct\"}",
+ "interval": "35",
+ "legendFormat": "{{pid}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "nginx\u8fdb\u7a0b\u5185\u5b58\u5229\u7528\u7387",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "\u663e\u793a\u7f51\u7edc\u6d41\u91cf\u4fe1\u606f",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 24,
+ "x": 0,
+ "y": 41
+ },
+ "id": 16,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_worker_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"inBytes\"}",
+ "interval": "35",
+ "legendFormat": "{{pid}}",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_nginx_main_metrics{exported_instance=\"$instance\", masterPid=\"$masterPid\", value=\"outBytes\"}",
+ "hide": false,
+ "interval": "35",
+ "legendFormat": "{{pid}}",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "nginx\u8fdb\u7a0b\u7f51\u7edc\u6d41\u91cf",
+ "type": "timeseries"
+ }
+ ],
+ "refresh": "30s",
+ "schemaVersion": 37,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "selected": false,
+ "text": "192.168.0.77",
+ "value": "192.168.0.77"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_nginx_main_metrics, exported_instance)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_nginx_main_metrics, exported_instance)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "selected": false,
+ "text": "809",
+ "value": "809"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_nginx_main_metrics, masterPid)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "masterPid",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_nginx_main_metrics, masterPid)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-30m",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "",
+ "title": "nginx",
+ "uid": "6Mztrm4Ik",
+ "version": 86,
+ "weekStart": ""
+ }
+}
\ No newline at end of file
diff --git a/deps/4_grafana/sysom-appobserver-nginx-events-dashboard.json b/deps/4_grafana/sysom-appobserver-nginx-events-dashboard.json
new file mode 100644
index 00000000..9e083221
--- /dev/null
+++ b/deps/4_grafana/sysom-appobserver-nginx-events-dashboard.json
@@ -0,0 +1,452 @@
+{
+ "dashboard": {
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": false,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 0,
+ "id": null,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 2,
+ "panels": [],
+ "title": "\u5f02\u5e38\u4e8b\u4ef6\u8be6\u60c5",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-mysql",
+ "description": "nginx http\u5f02\u5e38\u8bf7\u6c42\u8be6\u60c5",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "displayMode": "auto",
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "red"
+ }
+ ]
+ },
+ "unit": "\u00b5s"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "ts"
+ },
+ "properties": [
+ {
+ "id": "displayName",
+ "value": "time"
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "labels"
+ },
+ "properties": [
+ {
+ "id": "custom.hidden",
+ "value": true
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "instance"
+ },
+ "properties": [
+ {
+ "id": "custom.hidden",
+ "value": true
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "masterPid"
+ },
+ "properties": [
+ {
+ "id": "custom.hidden",
+ "value": true
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "diagId"
+ },
+ "properties": [
+ {
+ "id": "custom.hidden",
+ "value": true
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "status"
+ },
+ "properties": [
+ {
+ "id": "unit",
+ "value": "string"
+ },
+ {
+ "id": "custom.width",
+ "value": 166
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "requestTime"
+ },
+ "properties": [
+ {
+ "id": "unit",
+ "value": "ms"
+ },
+ {
+ "id": "custom.width",
+ "value": 158
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "upstreamResponseTime"
+ },
+ "properties": [
+ {
+ "id": "unit",
+ "value": "ms"
+ },
+ {
+ "id": "custom.width",
+ "value": 241
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "upstreamAddr"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 191
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "\u65f6\u95f4"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 190
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "remoteAddr"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 173
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "request"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 287
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "reason"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 259
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "app_diag"
+ },
+ "properties": [
+ {
+ "id": "displayName",
+ "value": "applicationDiagnosis"
+ },
+ {
+ "id": "custom.displayMode",
+ "value": "color-text"
+ },
+ {
+ "id": "links",
+ "value": [
+ {
+ "targetBlank": true,
+ "title": "",
+ "url": "http://sysom_test.qjm253.cn/diagnose/link/procdiag?instance=${instance}&ipport=${__data.fields.upstreamAddr}&time=30"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "diag"
+ },
+ "properties": [
+ {
+ "id": "custom.hidden",
+ "value": true
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "applicationDiagnosis"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 243
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "time"
+ },
+ "properties": [
+ {
+ "id": "custom.width",
+ "value": 272
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 12,
+ "w": 24,
+ "x": 0,
+ "y": 1
+ },
+ "id": 6,
+ "options": {
+ "footer": {
+ "enablePagination": true,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true,
+ "sortBy": []
+ },
+ "pluginVersion": "9.2.2",
+ "targets": [
+ {
+ "datasource": "sysom-mysql",
+ "editorMode": "code",
+ "expr": "",
+ "format": "table",
+ "legendFormat": "__auto",
+ "range": true,
+ "rawQuery": true,
+ "rawSql": "SELECT labels, instance,\n CASE \n WHEN JSON_EXTRACT(labels, '$.diag') = 'true'\n THEN '\u5e94\u7528\u6296\u52a8\u8bca\u65ad'\n ELSE '\u65e0'\n END AS app_diag\nFROM sysom.sys_alert_data\nWHERE instance = \"$instance\" AND JSON_EXTRACT(labels, '$.masterPid') = \"$masterPid\" AND UNIX_TIMESTAMP(created_at) > $__from / 1000 AND UNIX_TIMESTAMP(created_at) < $__to / 1000\nORDER BY alert_time DESC LIMIT 20\n",
+ "refId": "A",
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ }
+ }
+ ],
+ "title": "\u5f02\u5e38\u8bf7\u6c42\u8be6\u60c5",
+ "transformations": [
+ {
+ "id": "extractFields",
+ "options": {
+ "source": "labels"
+ }
+ },
+ {
+ "id": "organize",
+ "options": {
+ "excludeByName": {},
+ "indexByName": {
+ "app_diag": 13,
+ "diag": 12,
+ "diagId": 9,
+ "instance": 1,
+ "labels": 0,
+ "masterPid": 8,
+ "reason": 11,
+ "remoteAddr": 3,
+ "request": 5,
+ "requestTime": 6,
+ "status": 10,
+ "ts": 2,
+ "upstreamAddr": 4,
+ "upstreamResponseTime": 7
+ },
+ "renameByName": {}
+ }
+ }
+ ],
+ "type": "table"
+ }
+ ],
+ "refresh": "30s",
+ "schemaVersion": 37,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "selected": false,
+ "text": "192.168.0.77",
+ "value": "192.168.0.77"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_nginx_main_metrics, exported_instance)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_nginx_main_metrics, exported_instance)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "selected": false,
+ "text": "809",
+ "value": "809"
+ },
+ "datasource": "sysom-prometheus",
+ "definition": "label_values(sysom_nginx_main_metrics, masterPid)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "masterPid",
+ "options": [],
+ "query": {
+ "query": "label_values(sysom_nginx_main_metrics, masterPid)",
+ "refId": "StandardVariableQuery"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-30m",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "",
+ "title": "nginx-event",
+ "uid": "HtuWUeSSz",
+ "version": 25,
+ "weekStart": ""
+ }
+}
\ No newline at end of file
--
Gitee
From ed98ccce717127e3f621b58b1465c32d2235d62f Mon Sep 17 00:00:00 2001
From: zhilan
Date: Mon, 20 Nov 2023 10:29:23 +0800
Subject: [PATCH 028/176] Add vmcore wb test
vmcore_list,vmcore_config,vmcore_match
---
.../cypress/e2e/vmcore/vmcore_config.cy.js | 24 +++++++++++++++++++
.../cypress/e2e/vmcore/vmcore_list.cy.js | 14 +++++++++++
.../cypress/e2e/vmcore/vmcore_match.cy.js | 17 +++++++++++++
3 files changed, 55 insertions(+)
create mode 100644 sysom_web/cypress/e2e/vmcore/vmcore_config.cy.js
create mode 100644 sysom_web/cypress/e2e/vmcore/vmcore_list.cy.js
create mode 100644 sysom_web/cypress/e2e/vmcore/vmcore_match.cy.js
diff --git a/sysom_web/cypress/e2e/vmcore/vmcore_config.cy.js b/sysom_web/cypress/e2e/vmcore/vmcore_config.cy.js
new file mode 100644
index 00000000..306789fa
--- /dev/null
+++ b/sysom_web/cypress/e2e/vmcore/vmcore_config.cy.js
@@ -0,0 +1,24 @@
+///
+
+describe("vmcore list page", () => {
+ it("show vmcore list", () => {
+ cy.intercept("POST","/api/v1/vmcore/vmcore_config_test").as("vmcoreTest")
+ cy.login()
+ cy.visit("/vmcore/config")
+ /* ==== Generated with Cypress Studio ==== */
+ cy.get('#name').clear();
+ cy.get('#name').type("testconfig");
+ cy.get('#server_host').clear();
+ cy.get('#server_host').type("127.0.0.1");
+ cy.get('#mount_point').clear();
+ cy.get('#mount_point').type("/tmp/vmcore-nfs");
+ cy.get('#days').clear();
+ /* ==== Generated with Cypress Studio ==== */
+ cy.get('.ml20___wnEIC').click();
+ cy.get(':nth-child(1) > .ant-descriptions-item > .ant-descriptions-item-container > .ant-descriptions-item-content').should('have.text',"testconfig");
+ cy.get(':nth-child(2) > .ant-descriptions-item > .ant-descriptions-item-container > .ant-descriptions-item-content').should('have.text',"127.0.0.1");
+ cy.get(':nth-child(3) > .ant-descriptions-item > .ant-descriptions-item-container > .ant-descriptions-item-content').should('have.text',"/tmp/vmcore-nfs");
+ //cy.get('.configleft17___1xVO3').click();
+ /* ==== End Cypress Studio ==== */
+ })
+})
diff --git a/sysom_web/cypress/e2e/vmcore/vmcore_list.cy.js b/sysom_web/cypress/e2e/vmcore/vmcore_list.cy.js
new file mode 100644
index 00000000..93269ba3
--- /dev/null
+++ b/sysom_web/cypress/e2e/vmcore/vmcore_list.cy.js
@@ -0,0 +1,14 @@
+///
+
+describe("vmcore list page", () => {
+ it("show vmcore list", () => {
+ cy.login()
+ cy.visit("/vmcore/list")
+ /* ==== Generated with Cypress Studio ==== */
+ cy.get(':nth-child(1) > .ant-pro-card > .ant-pro-card-body > .ant-statistic > .ant-statistic-content > .ant-statistic-content-value > .ant-statistic-content-value-int').invoke('text').should('match',/^\d+/);
+ cy.get(':nth-child(3) > .ant-pro-card > .ant-pro-card-body > .ant-statistic > .ant-statistic-content > .ant-statistic-content-value > .ant-statistic-content-value-int').invoke('text').should('match',/^\d+/);
+ cy.get(':nth-child(5) > .ant-pro-card > .ant-pro-card-body > .ant-statistic > .ant-statistic-content > .ant-statistic-content-value ').invoke('text').should('match',/^\d+\.\d+$/);
+ cy.get(':nth-child(7) > .ant-pro-card > .ant-pro-card-body > .ant-statistic > .ant-statistic-content > .ant-statistic-content-value ').invoke('text').should('match',/^\d+\.\d+$/);
+ /* ==== End Cypress Studio ==== */
+ })
+})
diff --git a/sysom_web/cypress/e2e/vmcore/vmcore_match.cy.js b/sysom_web/cypress/e2e/vmcore/vmcore_match.cy.js
new file mode 100644
index 00000000..f7c1825a
--- /dev/null
+++ b/sysom_web/cypress/e2e/vmcore/vmcore_match.cy.js
@@ -0,0 +1,17 @@
+///
+
+describe("vmcore list page", () => {
+ it("show vmcore list", () => {
+ cy.login()
+ cy.visit("/vmcore/match")
+ /* ==== Generated with Cypress Studio ==== */
+ cy.get('#similar_dmesg').clear();
+ //let inputText = " [6231329.685410] Kernel panic - not syncing: sysrq triggered crash \n[6231329.685933] CPU: 3 PID: 514785 Comm: bash Kdump: loaded Tainted: G W E 5.10.134-14.an8.x86_64 #1 \n[6231329.686813] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 449e491 04/01/2014 \n[6231329.687515] Call Trace: \n[6231329.687759] dump_stack+0x57/0x6e\n [6231329.688070] panic+0x10d/0x2e9 \n[6231329.688392] sysrq_handle_crash+0x16/0x20\n [6231329.688759] __handle_sysrq.cold.18+0x7a/0xe8\n [6231329.689159] write_sysrq_trigger+0x2b/0x40 \n [6231329.689548] proc_reg_write+0x3b/0x80 \n[6231329.689887] vfs_write+0xb5/0x260 \n[6231329.690203] ksys_write+0x49/0xc0 \n[6231329.690523] do_syscall_64+0x33/0x40 \n[6231329.690853] entry_SYSCALL_64_after_hwframe+0x61/0xc6 \n[6231329.691325] RIP: 0033:0x7f4d40d205a8 ";
+ //cy.get("#similar_dmesg").invoke('val', inputText)
+ //cy.get('#similar_dmesg').type( " [6231329.685410] Kernel panic - not syncing: sysrq triggered crash \n[6231329.685933] CPU: 3 PID: 514785 Comm: bash Kdump: loaded Tainted: G W E 5.10.134-14.an8.x86_64 #1 \n[6231329.686813] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 449e491 04/01/2014 \n[6231329.687515] Call Trace: \n[6231329.687759] dump_stack+0x57/0x6e\n [6231329.688070] panic+0x10d/0x2e9 \n[6231329.688392] sysrq_handle_crash+0x16/0x20\n [6231329.688759] __handle_sysrq.cold.18+0x7a/0xe8\n [6231329.689159] write_sysrq_trigger+0x2b/0x40 \n [6231329.689548] proc_reg_write+0x3b/0x80 \n[6231329.689887] vfs_write+0xb5/0x260 \n[6231329.690203] ksys_write+0x49/0xc0 \n[6231329.690523] do_syscall_64+0x33/0x40 \n[6231329.690853] entry_SYSCALL_64_after_hwframe+0x61/0xc6 \n[6231329.691325] RIP: 0033:0x7f4d40d205a8 ");
+ cy.get('#similar_dmesg').type("123")
+ cy.get(':nth-child(2) > .ant-btn').click();
+ cy.get('table > tbody').eq(0).children().should('have.length.of.at.least',1)
+ /* ==== End Cypress Studio ==== */
+ })
+})
--
Gitee
From abeddd89fd245673525d6a56b073c46af878bae4 Mon Sep 17 00:00:00 2001
From: JietaoXiao
Date: Fri, 15 Dec 2023 10:38:30 +0800
Subject: [PATCH 029/176] feat(cluster_health): update cluster,node,contianer
grafana dashboard to adapt new metrics
---
deps/4_grafana/sysom-cluster-dashboard.json | 77 +-
deps/4_grafana/sysom-container-dashboard.json | 2279 ++++++++---------
.../4_grafana/sysom-sysak-base-dashboard.json | 84 +-
3 files changed, 1225 insertions(+), 1215 deletions(-)
diff --git a/deps/4_grafana/sysom-cluster-dashboard.json b/deps/4_grafana/sysom-cluster-dashboard.json
index 27211ce5..a09726c4 100644
--- a/deps/4_grafana/sysom-cluster-dashboard.json
+++ b/deps/4_grafana/sysom-cluster-dashboard.json
@@ -83,6 +83,7 @@
"y": 1
},
"id": 76,
+ "interval": "30s",
"options": {
"orientation": "auto",
"reduceOptions": {
@@ -100,7 +101,7 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cluster_health_score{cluster=\"c7a06b4a325114f3fa394c113286f9396\",type=\"total\"}",
+ "expr": "sysom_cluster_health_score{cluster=~\"$cluster\",type=\"total\"}",
"legendFormat": "{{exported_instance}}",
"range": true,
"refId": "A"
@@ -167,6 +168,7 @@
"y": 1
},
"id": 78,
+ "interval": "30s",
"links": [],
"maxDataPoints": 100,
"options": {
@@ -258,6 +260,7 @@
"y": 1
},
"id": 80,
+ "interval": "30s",
"links": [],
"maxDataPoints": 100,
"options": {
@@ -349,6 +352,7 @@
"y": 1
},
"id": 82,
+ "interval": "30s",
"links": [],
"maxDataPoints": 100,
"options": {
@@ -440,6 +444,7 @@
"y": 1
},
"id": 84,
+ "interval": "30s",
"links": [],
"maxDataPoints": 100,
"options": {
@@ -640,7 +645,7 @@
},
"folderName": "General",
"folderUid": "",
- "updated": "2023-11-28T15:16:24+08:00",
+ "updated": "2023-12-14T19:12:15+08:00",
"updatedBy": {
"avatarUrl": "/grafana/avatar/46d229b033af06a191ff2267bca9ae56",
"id": 1,
@@ -650,7 +655,7 @@
"name": "Nodes Overview",
"type": "table",
"uid": "0nulMpNSz",
- "version": 1
+ "version": 2
},
"options": {
"footer": {
@@ -676,7 +681,7 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": false,
- "expr": "bottomk(5, sysom_node_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"score\"})",
+ "expr": "bottomk(5, sysom_node_health_metric{cluster=\"$cluster\", mode=\"score\"})",
"format": "table",
"instant": true,
"legendFormat": "__auto",
@@ -687,7 +692,7 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": false,
- "expr": "(bottomk(5, sysom_node_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"score\"}) * 0) + on(description, exported_instance,type) sysom_node_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"value\"}",
+ "expr": "(bottomk(5, sysom_node_health_metric{cluster=\"$cluster\", mode=\"score\"}) * 0) + on(description, exported_instance,type) sysom_node_health_metric{cluster=\"$cluster\", mode=\"value\"}",
"format": "table",
"hide": false,
"instant": true,
@@ -915,7 +920,7 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": false,
- "expr": "bottomk(5, sysom_pod_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"score\"})",
+ "expr": "bottomk(5, sysom_pod_health_metric{cluster=\"$cluster\", mode=\"score\"})",
"format": "table",
"instant": true,
"legendFormat": "__auto",
@@ -926,7 +931,7 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": false,
- "expr": "(bottomk(5, sysom_pod_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"score\"}) * 0) + on(description, pod, namespace, type) sysom_pod_health_metric{cluster=\"c7a06b4a325114f3fa394c113286f9396\", mode=\"value\"}",
+ "expr": "(bottomk(5, sysom_pod_health_metric{cluster=\"$cluster\", mode=\"score\"}) * 0) + on(description, pod, namespace, type) sysom_pod_health_metric{cluster=\"$cluster\", mode=\"value\"}",
"format": "table",
"hide": false,
"instant": true,
@@ -1675,7 +1680,7 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": true,
- "expr": "sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", value=\"memDrcm_lat_1000ms\"}[$__rate_interval])) by (instance) + sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", value=\"memDrcm_lat_10to100ms\"}[$__rate_interval])) by (instance) + sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", value=\"memDrcm_lat_500to1000ms\"}[$__rate_interval])) by (instance)",
+ "expr": "sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_1000ms\"}[$__rate_interval])) by (instance) + sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_10to100ms\"}[$__rate_interval])) by (instance) + sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_500to1000ms\"}[$__rate_interval])) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "{{instance}}",
@@ -1806,10 +1811,10 @@
"datasource": "sysom-prometheus",
"editorMode": "code",
"exemplar": true,
- "expr": "sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", valye=\"memDrcm_lat_10to100ms\"}[$__rate_interval])) by (podname, instance) + sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", valye=\"memDrcm_lat_100to500ms\"}[$__rate_interval])) by (podname, instance) sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", valye=\"memDrcm_lat_500to1000ms\"}[$__rate_interval])) by (podname, instance) + sum(rate(sysom_container_memory_cdrcm_latency{pod!=\"\", valye=\"memDrcm_lat_1000ms\"}[$__rate_interval])) by (podname, instance)",
+ "expr": "sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_10to100ms\"}[$__rate_interval])) by (pod, instance) + sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_100to500ms\"}[$__rate_interval])) by (pod, instance) + sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_500to1000ms\"}[$__rate_interval])) by (pod, instance) + sum(rate(sysom_container_memdrcm_latency{pod!=\"\", value=\"memDrcm_lat_1000ms\"}[$__rate_interval])) by (pod, instance)",
"hide": false,
"interval": "",
- "legendFormat": "{{podname}}",
+ "legendFormat": "{{pod}}",
"range": true,
"refId": "B"
}
@@ -1866,7 +1871,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "yellow",
@@ -1972,7 +1978,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "#EAB839",
@@ -2101,7 +2108,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "orange",
@@ -2217,7 +2225,8 @@
"mode": "absolute",
"steps": [
{
- "color": "super-light-blue"
+ "color": "super-light-blue",
+ "value": null
},
{
"color": "super-light-yellow",
@@ -2342,7 +2351,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2429,7 +2439,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2565,7 +2576,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2691,7 +2703,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2798,7 +2811,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2952,7 +2966,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -3059,7 +3074,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -3214,7 +3230,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -3332,7 +3349,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -3456,13 +3474,12 @@
"list": [
{
"current": {
- "isNone": true,
- "selected": false,
- "text": "None",
- "value": ""
+ "selected": true,
+ "text": "default",
+ "value": "default"
},
"datasource": "sysom-prometheus",
- "definition": "label_values(sysom_proc_cpu_total, cluster)",
+ "definition": "label_values(sysom_cluster_health_score, cluster)",
"hide": 0,
"includeAll": false,
"label": "cluster",
@@ -3470,7 +3487,7 @@
"name": "cluster",
"options": [],
"query": {
- "query": "label_values(sysom_proc_cpu_total, cluster)",
+ "query": "label_values(sysom_cluster_health_score, cluster)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
@@ -3545,7 +3562,7 @@
"timezone": "",
"title": "\u96c6\u7fa4\u89c6\u89d2",
"uid": "F4UBT8w4k",
- "version": 54,
+ "version": 63,
"weekStart": ""
}
}
\ No newline at end of file
diff --git a/deps/4_grafana/sysom-container-dashboard.json b/deps/4_grafana/sysom-container-dashboard.json
index a607fffe..4c7676d1 100644
--- a/deps/4_grafana/sysom-container-dashboard.json
+++ b/deps/4_grafana/sysom-container-dashboard.json
@@ -193,7 +193,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "",
+ "legendFormat": "{{pod}}",
"refId": "A",
"step": 20
}
@@ -284,7 +284,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "",
+ "legendFormat": "{{pod}}",
"refId": "A",
"step": 20
}
@@ -375,7 +375,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "",
+ "legendFormat": "{{pod}}",
"refId": "A",
"step": 20
}
@@ -466,7 +466,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "",
+ "legendFormat": "{{pod}}",
"refId": "A",
"step": 20
}
@@ -569,7 +569,7 @@
},
{
"id": "custom.width",
- "value": 98
+ "value": 107
}
]
},
@@ -590,8 +590,7 @@
}
},
{
- "id": "custom.width",
- "value": 170
+ "id": "custom.width"
}
]
},
@@ -603,7 +602,7 @@
"properties": [
{
"id": "custom.width",
- "value": 136
+ "value": 176
}
]
}
@@ -817,8 +816,7 @@
}
},
{
- "id": "custom.width",
- "value": 170
+ "id": "custom.width"
}
]
},
@@ -830,7 +828,7 @@
"properties": [
{
"id": "custom.width",
- "value": 136
+ "value": 215
}
]
}
@@ -1044,8 +1042,7 @@
}
},
{
- "id": "custom.width",
- "value": 170
+ "id": "custom.width"
}
]
},
@@ -1056,8 +1053,7 @@
},
"properties": [
{
- "id": "custom.width",
- "value": 136
+ "id": "custom.width"
}
]
}
@@ -1271,8 +1267,7 @@
}
},
{
- "id": "custom.width",
- "value": 170
+ "id": "custom.width"
}
]
},
@@ -1283,8 +1278,7 @@
},
"properties": [
{
- "id": "custom.width",
- "value": 136
+ "id": "custom.width"
}
]
}
@@ -1473,8 +1467,8 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "topk(5, sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"usage\"}) by (podname, value))",
- "legendFormat": "{{podname}}",
+ "expr": "topk(5, sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"}) by (pod, value))",
+ "legendFormat": "{{pod}}",
"range": true,
"refId": "A"
}
@@ -1561,8 +1555,8 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "topk(5, sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"cache\"}) by (podname, value))",
- "legendFormat": "{{podname}}",
+ "expr": "topk(5, sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"cache\"}) by (pod, value))",
+ "legendFormat": "{{pod}}",
"range": true,
"refId": "A"
}
@@ -1612,7 +1606,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -1651,80 +1646,80 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"cache\"}) by (podname, value)",
- "legendFormat": "{{podname}}-{{value}}",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"cache\"}) by (pod, value)",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"rss\"}) by (podname,value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$podname\",value=\"rss\"}) by (pod,value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "B"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"shmem\"}) by (podname,value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"shmem\"}) by (pod,value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "D"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"inactive_file\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"inactive_file\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "C"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"active_file\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"active_file\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "E"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"inactive_anon\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"inactive_anon\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "F"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"active_file\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"active_file\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "G"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"usage\"} - ignoring(value)sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"inactive_file\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"} - ignoring(value)sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"inactive_file\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-wss",
+ "legendFormat": "{{pod}}-wss",
"range": true,
"refId": "H"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"usage\"}) by (podname, value)",
+ "expr": "sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"}) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "I"
}
@@ -1774,7 +1769,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -1814,8 +1810,8 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_podmem{podns=~\"$podns\",podname=~\"$podname\",value=\"cached\"}",
- "legendFormat": "{{podname}}-{{file}}",
+ "expr": "sysom_podmem{namespace=~\"$podns\",pod=~\"$pod\",value=\"cached\"}",
+ "legendFormat": "{{pod}}-{{file}}",
"range": true,
"refId": "A"
}
@@ -1865,7 +1861,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -1905,35 +1902,35 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(rate(sysom_cg_memfail_cnt{podns=~\"$podns\",podname=~\"$podname\",value=\"fail_cnt\"}[$__rate_interval])) by (podname, value)",
- "legendFormat": "{{podname}}-{{value}}",
+ "expr": "sum(rate(sysom_container_memfail_cnt{namespace=~\"$podns\",pod=~\"$pod\",value=\"fail_cnt\"}[$__rate_interval])) by (pod, value)",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(rate(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"pgpgin\"}[$__rate_interval])) by (podname, value)",
+ "expr": "sum(rate(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"pgpgin\"}[$__rate_interval])) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "B"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(rate(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"pgpgout\"}[$__rate_interval])) by (podname, value)",
+ "expr": "sum(rate(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"pgpgout\"}[$__rate_interval])) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "C"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(rate(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"pgfault\"}[$__rate_interval])) by (podname, value)",
+ "expr": "sum(rate(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"pgfault\"}[$__rate_interval])) by (pod, value)",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-{{value}}",
"range": true,
"refId": "D"
}
@@ -1983,7 +1980,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2022,26 +2020,26 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"mem_util\"}) by (podname, value)",
- "legendFormat": "{{podname}}-{{value}}",
+ "expr": "(sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"}) by (pod, container) / sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"limit\"}) by (pod, container)) * 100",
+ "legendFormat": "{{pod}}-usage",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"rss_ratio\"}) by (podname, value)",
+ "expr": "(sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"rss\"}) by (pod, container) / sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"}) by (pod, container)) * 100",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-rss_ratio",
"range": true,
"refId": "B"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sum(sysom_cg_memUtil{podns=~\"$podns\",podname=~\"$podname\",value=\"cache_ratio\"}) by (podname, value)",
+ "expr": "(sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"cache\"}) by (pod, container) / sum(sysom_container_memUtil{namespace=~\"$podns\",pod=~\"$pod\",value=\"usage\"}) by (pod, container)) * 100",
"hide": false,
- "legendFormat": "{{podname}}-{{value}}",
+ "legendFormat": "{{pod}}-cache_ratio",
"range": true,
"refId": "C"
}
@@ -2130,35 +2128,35 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memgdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_0to1ms\"} + on(podname, container)sysom_cg_memgdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_1to5ms\"} + on(podname, container)sysom_cg_memgdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_5to10ms\"}",
- "legendFormat": "{{podname}}-memDrcm_glb_lat_1to10ms",
+ "expr": "clamp_min(sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_0to1ms\"} + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_1to5ms\"} + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_5to10ms\"}) by (pod) - sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_0to1ms\"} offset 30s + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_1to5ms\"} offset 30s + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_5to10ms\"} offset 30s) by (pod), 0)",
+ "legendFormat": "{{pod}}-memDrcm_glb_lat_1to10ms",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memgdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_10to100ms\"}",
+ "expr": "clamp_min(sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_10to100ms\"}) by (pod) - sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_10to100ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_glb_lat_10to100ms",
+ "legendFormat": "{{pod}}-memDrcm_glb_lat_10to100ms",
"range": true,
"refId": "B"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memgdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_100to500ms\"}",
+ "expr": "clamp_min(sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_100to500ms\"}) by (pod) - sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_100to500ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_glb_lat_100to500ms",
+ "legendFormat": "{{pod}}-memDrcm_glb_lat_100to500ms",
"range": true,
"refId": "D"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_500to1000ms\"} + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_glb_lat_1000ms\"}",
+ "expr": "clamp_min(sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_500to1000ms\"} + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_1000ms\"}) by (pod) - sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_500to1000ms\"} offset 30s + on(pod, container)sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_glb_lat_1000ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_glb_lat_500to1000ms",
+ "legendFormat": "{{pod}}-memDrcm_glb_lat_500to1000ms",
"range": true,
"refId": "C"
}
@@ -2248,35 +2246,35 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "clamp_min(sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_0to1ms\"} + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_1to5ms\"} + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_5to10ms\"}) by (podname) - sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_0to1ms\"} offset 30s + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_1to5ms\"} offset 30s + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_5to10ms\"} offset 30s) by (podname), 0)",
- "legendFormat": "{{podname}}-memDrcm_lat_1to10ms",
+ "expr": "clamp_min(sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_0to1ms\"} + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_1to5ms\"} + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_5to10ms\"}) by (pod) - sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_0to1ms\"} offset 30s + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_1to5ms\"} offset 30s + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_5to10ms\"} offset 30s) by (pod), 0)",
+ "legendFormat": "{{pod}}-memDrcm_lat_1to10ms",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "clamp_min(sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_10to100ms\"}) by (podname) - sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_10to100ms\"} offset 30s) by (podname), 0)",
+ "expr": "clamp_min(sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_10to100ms\"}) by (pod) - sum(sysom_container_memgdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_10to100ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_lat_10to100ms",
+ "legendFormat": "{{pod}}-memDrcm_lat_10to100ms",
"range": true,
"refId": "B"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "clamp_min(sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_100to500ms\"}) by (podname) - sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_100to500ms\"} offset 30s) by (podname), 0)",
+ "expr": "clamp_min(sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_100to500ms\"}) by (pod) - sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_100to500ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_lat_100to500ms",
+ "legendFormat": "{{pod}}-memDrcm_lat_100to500ms",
"range": true,
"refId": "D"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "clamp_min(sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_500to1000ms\"} + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_1000ms\"}) by (podname) - sum(sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_500to1000ms\"} offset 30s + on(podname, container)sysom_cg_memdrcm_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDrcm_lat_1000ms\"} offset 30s) by (podname), 0)",
+ "expr": "clamp_min(sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_500to1000ms\"} + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_1000ms\"}) by (pod) - sum(sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_500to1000ms\"} offset 30s + on(pod, container)sysom_container_memdrcm_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDrcm_lat_1000ms\"} offset 30s) by (pod), 0)",
"hide": false,
- "legendFormat": "{{podname}}-memDrcm_lat_500to1000ms",
+ "legendFormat": "{{pod}}-memDrcm_lat_500to1000ms",
"range": true,
"refId": "C"
}
@@ -2365,17 +2363,17 @@
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memmcmp_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDcmp_lat_1to5ms\"} + on(podname, container)sysom_cg_memmcmp_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDcmp_lat_5to10ms\"}",
- "legendFormat": "{{podname}}-memDcmp_lat_1to10ms",
+ "expr": "clamp_min(sum(sysom_container_memmcmp_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDcmp_lat_1to5ms\"} + on(pod, container)sysom_container_memmcmp_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDcmp_lat_5to10ms\"}) by (pod) - sum(sysom_container_memmcmp_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDcmp_lat_1to5ms\"} offset 30s + on(pod, container)sysom_container_memmcmp_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDcmp_lat_5to10ms\"} offset 30s) by (pod), 0)",
+ "legendFormat": "{{pod}}-memDcmp_lat_1to10ms",
"range": true,
"refId": "A"
},
{
"datasource": "sysom-prometheus",
"editorMode": "code",
- "expr": "sysom_cg_memmcmp_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDcmp_lat_10to100ms\"}",
+ "expr": "sysom_container_memmcmp_latency{namespace=~\"$podns\",pod=~\"$pod\",value=\"memDcmp_lat_10to100ms\"}",
"hide": false,
- "legendFormat": "{{podname}}-memDcmp_lat_10to100ms",
+ "legendFormat": "{{pod}}-memDcmp_lat_10to100ms",
"range": true,
"refId": "B"
},
@@ -2384,7 +2382,7 @@
"editorMode": "code",
"expr": "sysom_cg_memmcmp_latency{podns=~\"$podns\",podname=~\"$podname\",value=\"memDcmp_lat_100to500ms\"}",
"hide": false,
- "legendFormat": "{{podname}}-memDcmp_lat_100to500ms",
+ "legendFormat": "{{pod}}-memDcmp_lat_100to500ms",
"range": true,
"refId": "D"
},
@@ -2402,7 +2400,7 @@
"type": "timeseries"
},
{
- "collapsed": true,
+ "collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
@@ -2410,1088 +2408,1079 @@
"y": 61
},
"id": 417,
- "panels": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "L05sxa7Sz"
- },
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "percent"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 11
- },
- "id": 419,
- "options": {
- "legend": {
- "calcs": [
- "min",
- "mean",
- "max"
- ],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
+ "panels": [],
+ "title": "Pod CPU Monitor",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
},
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(sysom_container_cpu_acctstat{namespace=~\"$podns\",pod=~\"$podname\",type=\"total\"}) by (pod)",
- "legendFormat": "{{podname}}-{{value}}",
- "range": true,
- "refId": "A"
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(sysom_container_cpu_acctstat{namespace=~\"$podns\",pod=~\"$podname\",type=\"user\"}) by (pod)",
- "hide": false,
- "legendFormat": "{{podname}}-{{value}}",
- "range": true,
- "refId": "B"
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(sysom_container_cpu_acctstat{namespace=~\"$podns\",pod=~\"$podname\",type=\"system\"}) by (pod)",
- "hide": false,
- "legendFormat": "{{podname}}-{{value}}",
- "range": true,
- "refId": "C"
- }
- ],
- "title": "Pod CPU Usage",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
},
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 11
- },
- "id": 420,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [
- "min",
- "mean",
- "max"
- ],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "rate(sysom_cg_cpu_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"nr_throttled\"}[$__rate_interval])",
- "legendFormat": "{{podname}}-throttled",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Pod CPU nr_throttled",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "xs7waXX4k"
- },
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "dashed+area"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 15
- }
- ]
- },
- "unit": "ms"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 19
- },
- "id": 441,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
+ "thresholdsStyle": {
+ "mode": "off"
}
},
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "rate(sysom_cg_cpuacct_wait_latency{value=\"wait_lat_total\"}[$__rate_interval])",
- "legendFormat": "{{podname}}-quota_ratio",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Pod wait_latency",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
},
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
+ {
+ "color": "red",
+ "value": 80
}
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 19
- },
- "id": 442,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
+ ]
},
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sysom_cg_cfs_quota{value=\"quota_ratio\",podns=~\"$podns\",podname=~\"$podname\"}",
- "legendFormat": "{{podname}}-quota_ratio",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Pod cfs_quota",
- "type": "timeseries"
- }
- ],
- "title": "Pod CPU Monitor",
- "type": "row"
- },
- {
- "collapsed": true,
+ "unit": "percent"
+ },
+ "overrides": []
+ },
"gridPos": {
- "h": 1,
- "w": 24,
+ "h": 8,
+ "w": 12,
"x": 0,
"y": 62
},
- "id": 424,
- "panels": [
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "bytes rx (-) / tx (+)",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 21,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "Bps"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 12
- },
- "id": 438,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(rate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_tx_bytes\"}[5m])) by (podname)",
- "legendFormat": "{{podname}}-transmit",
- "range": true,
- "refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(rate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_rx_bytes\"}[5m])) by (podname)",
- "hide": false,
- "legendFormat": "{{podname}}-receive",
- "range": true,
- "refId": "B"
- }
- ],
- "title": "Pod Network Traffic by Bytes",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "packets rx (-) / tx (+)",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 30,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "pps"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 12
- },
- "id": 428,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(rate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_tx_packets\"}[5m])) by (podname)",
- "legendFormat": "{{podname}}-transmit",
- "range": true,
- "refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(rate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_rx_packets\"}[5m])) by (podname)",
- "hide": false,
- "legendFormat": "{{podname}}-reads",
- "range": true,
- "refId": "B"
- }
- ],
- "title": "Pod Network Traffic by Packets",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 20
- },
- "id": 440,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(irate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_tx_dropped\"}[5m])) by (podname) / sum(irate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_tx_packets\"}[5m])) by (podname)",
- "legendFormat": "{{podname}}-tx-drop",
- "range": true,
- "refId": "A"
- },
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(irate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_rx_dropped\"}[5m])) by (podname) / sum(irate(sysom_container_network_stat{podns=~\"$podns\",podname=~\"$podname\",value=\"net_rx_packets\"}[5m])) by (podname)",
- "hide": false,
- "legendFormat": "{{podname}}-rx-drop",
- "range": true,
- "refId": "B"
- }
+ "id": 419,
+ "options": {
+ "legend": {
+ "calcs": [
+ "min",
+ "mean",
+ "max"
],
- "title": "Pod Network Traffic Drop",
- "type": "timeseries"
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(sysom_container_cpuacct_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"total\"}) by (pod)",
+ "legendFormat": "{{pod}}-{{value}}",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(sysom_container_cpuacct_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"user\"}) by (pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-{{value}}",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(sysom_container_cpuacct_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"system\"}) by (pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-{{value}}",
+ "range": true,
+ "refId": "C"
}
],
- "title": "Pod Network Monitor",
- "type": "row"
+ "title": "Pod CPU Usage",
+ "type": "timeseries"
},
{
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 63
- },
- "id": 422,
- "panels": [
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "MiB reads (-) / writes (+)",
- "axisPlacement": "auto",
- "barAlignment": -1,
- "drawStyle": "line",
- "fillOpacity": 21,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "MiBs"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 4
- },
- "id": 430,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
},
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(rate(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\", value=\"writes_service_bytes\"}[5m]) / (1024 * 1024)) by (device,podname)",
- "legendFormat": "{{podname}}-{{device}}-writes",
- "range": true,
- "refId": "A"
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(rate(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\", value=\"reads_service_bytes\"}[5m]) / (1024 * 1024)) by (podname,device)",
- "hide": false,
- "legendFormat": "{{podname}}-{{device}}-reads",
- "range": true,
- "refId": "B"
- }
- ],
- "title": "Pod Writes/Reads Bytes Rates",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "description": "",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "IO requests reads (-) / writes(+)",
- "axisPlacement": "auto",
- "barAlignment": -1,
- "drawStyle": "line",
- "fillOpacity": 30,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 4
- },
- "id": 432,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(rate(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\", value=\"writes_serviced\"}[5m])) by (device, podname)",
- "legendFormat": "{{podname}}-{{device}}-writes",
- "range": true,
- "refId": "A"
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(rate(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\", value=\"reads_serviced\"}[5m])) by (device, podname)",
- "hide": false,
- "legendFormat": "{{podname}}-{{device}}-reads",
- "range": true,
- "refId": "B"
- }
- ],
- "title": "Pod Writes/Reads IOs Rates",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "MiB reads (-) / writes (+)",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "MiBs"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 12
- },
- "id": 434,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\",value=\"writes_bytes_queued\"}) by (device,podname)",
- "legendFormat": "{{podname}}-{{device}}-writes",
- "range": true,
- "refId": "A"
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\",value=\"reads_bytes_queued\"} / (1024 * 1024)) by (device,podname)",
- "hide": false,
- "legendFormat": "{{podname}}-{{device}}-reads",
- "range": true,
- "refId": "B"
+ "thresholdsStyle": {
+ "mode": "off"
}
- ],
- "title": "Pod IO Queued",
- "type": "timeseries"
- },
- {
- "datasource": "sysom-prometheus",
- "description": "",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "ms read (-) / writes(+)",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 25,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "ms"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 12
- },
- "id": 436,
- "interval": "60s",
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 62
+ },
+ "id": 420,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [
+ "min",
+ "mean",
+ "max"
+ ],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "rate(sysom_container_cpu_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"nr_throttled\"}[$__rate_interval])",
+ "legendFormat": "{{pod}}-throttled",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Pod CPU nr_throttled",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "dashed+area"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 15
+ }
+ ]
+ },
+ "unit": "ms"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 70
+ },
+ "id": 441,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "rate(sysom_container_cpuacct_wait_latency{value=\"wait_lat_total\"}[$__rate_interval])",
+ "legendFormat": "{{pod}}-quota_ratio",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Pod wait_latency",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 70
+ },
+ "id": 442,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sysom_container_cfs_quota{value=\"quota_ratio\",namespace=~\"$podns\",pod=~\"$pod\"}",
+ "legendFormat": "{{pod}}-quota_ratio",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Pod cfs_quota",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 78
+ },
+ "id": 424,
+ "panels": [],
+ "title": "Pod Network Monitor",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "bytes rx (-) / tx (+)",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 21,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "Bps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 79
+ },
+ "id": 438,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(rate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_tx_bytes\"}[5m])) by (pod)",
+ "legendFormat": "{{pod}}-transmit",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(rate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_rx_bytes\"}[5m])) by (pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-receive",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod Network Traffic by Bytes",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "packets rx (-) / tx (+)",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 30,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "pps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 79
+ },
+ "id": 428,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(rate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_tx_packets\"}[5m])) by (pod)",
+ "legendFormat": "{{pod}}-transmit",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(rate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_rx_packets\"}[5m])) by (pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-reads",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod Network Traffic by Packets",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 87
+ },
+ "id": 440,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_tx_dropped\"}[5m])) by (pod) / sum(irate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_tx_packets\"}[5m])) by (pod)",
+ "legendFormat": "{{pod}}-tx-drop",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(irate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_rx_dropped\"}[5m])) by (pod) / sum(irate(sysom_container_network_stat{namespace=~\"$podns\",pod=~\"$pod\",value=\"net_rx_packets\"}[5m])) by (pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-rx-drop",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod Network Traffic Drop",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 95
+ },
+ "id": 422,
+ "panels": [],
+ "title": "Pod IO Monitor",
+ "type": "row"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "MiB reads (-) / writes (+)",
+ "axisPlacement": "auto",
+ "barAlignment": -1,
+ "drawStyle": "line",
+ "fillOpacity": 21,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "smooth",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "MiBs"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 96
+ },
+ "id": 430,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(rate(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\", value=\"writes_service_bytes\"}[5m]) / (1024 * 1024)) by (device,pod)",
+ "legendFormat": "{{pod}}-{{device}}-writes",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(rate(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\", value=\"reads_service_bytes\"}[5m]) / (1024 * 1024)) by (pod,device)",
+ "hide": false,
+ "legendFormat": "{{pod}}-{{device}}-reads",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod Writes/Reads Bytes Rates",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "IO requests reads (-) / writes(+)",
+ "axisPlacement": "auto",
+ "barAlignment": -1,
+ "drawStyle": "line",
+ "fillOpacity": 30,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "smooth",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
}
},
- "targets": [
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "sum(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\",value=\"writes_wait_time\"} / 1000000) by (device,podname)",
- "legendFormat": "{{podname}}-{{device}}-writes",
- "range": true,
- "refId": "A"
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 96
+ },
+ "id": 432,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(rate(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\", value=\"writes_serviced\"}[5m])) by (device, pod)",
+ "legendFormat": "{{pod}}-{{device}}-writes",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(rate(sysom_cg_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\", value=\"reads_serviced\"}[5m])) by (device, pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-{{device}}-reads",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod Writes/Reads IOs Rates",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "MiB reads (-) / writes (+)",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
},
- {
- "datasource": "sysom-prometheus",
- "editorMode": "code",
- "expr": "-sum(sysom_cg_blkio_stat{podns=~\"$podns\", podname=~\"$podname\", podname=~\".+\",value=\"reads_wait_time\"} / 1000000) by (device,podname)",
- "hide": false,
- "legendFormat": "{{podname}}-{{device}}-reads",
- "range": true,
- "refId": "B"
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
}
- ],
- "title": "Pod IO Wait Time",
- "type": "timeseries"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "MiBs"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 104
+ },
+ "id": 434,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\",value=\"writes_bytes_queued\"}) by (device,pod)",
+ "legendFormat": "{{pod}}-{{device}}-writes",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\",value=\"reads_bytes_queued\"} / (1024 * 1024)) by (device,pod)",
+ "hide": false,
+ "legendFormat": "{{pod}}-{{device}}-reads",
+ "range": true,
+ "refId": "B"
}
],
- "title": "Pod IO Monitor",
- "type": "row"
+ "title": "Pod IO Queued",
+ "type": "timeseries"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "ms read (-) / writes(+)",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 25,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "ms"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 104
+ },
+ "id": 436,
+ "interval": "60s",
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "sum(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\",value=\"writes_wait_time\"} / 1000000) by (device,pod)",
+ "legendFormat": "{{podname}}-{{device}}-writes",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": "sysom-prometheus",
+ "editorMode": "code",
+ "expr": "-sum(sysom_container_blkio_stat{namespace=~\"$podns\", pod=~\"$pod\", pod=~\".+\",value=\"reads_wait_time\"} / 1000000) by (device,pod)",
+ "hide": false,
+ "legendFormat": "{{podname}}-{{device}}-reads",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Pod IO Wait Time",
+ "type": "timeseries"
}
],
"refresh": "5s",
@@ -3528,10 +3517,13 @@
},
{
"current": {
- "isNone": true,
- "selected": false,
- "text": "None",
- "value": ""
+ "selected": true,
+ "text": [
+ "condescending_mirzakhani"
+ ],
+ "value": [
+ "condescending_mirzakhani"
+ ]
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_container_memory_oomcnt,pod)",
@@ -3553,10 +3545,9 @@
},
{
"current": {
- "isNone": true,
"selected": false,
- "text": "None",
- "value": ""
+ "text": "192.168.0.11:8400",
+ "value": "192.168.0.11:8400"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_proc_cpu_total, instance)",
@@ -3610,7 +3601,7 @@
"timezone": "browser",
"title": "\u5bb9\u5668\u76d1\u63a7",
"uid": "rYdddlPWW",
- "version": 37,
+ "version": 78,
"weekStart": ""
}
}
\ No newline at end of file
diff --git a/deps/4_grafana/sysom-sysak-base-dashboard.json b/deps/4_grafana/sysom-sysak-base-dashboard.json
index 69a67af0..770a990c 100644
--- a/deps/4_grafana/sysom-sysak-base-dashboard.json
+++ b/deps/4_grafana/sysom-sysak-base-dashboard.json
@@ -512,12 +512,13 @@
"overrides": []
},
"gridPos": {
- "h": 4,
+ "h": 5,
"w": 24,
"x": 0,
"y": 6
},
"id": 417,
+ "interval": "30s",
"options": {
"orientation": "auto",
"reduceOptions": {
@@ -683,7 +684,7 @@
"h": 8,
"w": 6,
"x": 0,
- "y": 10
+ "y": 11
},
"id": 419,
"interval": "30s",
@@ -900,7 +901,7 @@
"h": 8,
"w": 6,
"x": 6,
- "y": 10
+ "y": 11
},
"id": 421,
"interval": "30s",
@@ -1121,7 +1122,7 @@
"h": 8,
"w": 6,
"x": 12,
- "y": 10
+ "y": 11
},
"id": 423,
"interval": "30s",
@@ -1342,7 +1343,7 @@
"h": 8,
"w": 6,
"x": 18,
- "y": 10
+ "y": 11
},
"id": 425,
"interval": "30s",
@@ -1435,7 +1436,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 18
+ "y": 19
},
"id": 261,
"panels": [],
@@ -1474,7 +1475,7 @@
"h": 2,
"w": 4,
"x": 0,
- "y": 19
+ "y": 20
},
"id": 14,
"links": [],
@@ -1540,7 +1541,7 @@
"h": 2,
"w": 4,
"x": 4,
- "y": 19
+ "y": 20
},
"id": 75,
"links": [],
@@ -1604,7 +1605,7 @@
"h": 2,
"w": 4,
"x": 8,
- "y": 19
+ "y": 20
},
"id": 321,
"links": [],
@@ -1668,7 +1669,7 @@
"h": 2,
"w": 4,
"x": 12,
- "y": 19
+ "y": 20
},
"id": 390,
"links": [],
@@ -1731,7 +1732,7 @@
"h": 2,
"w": 4,
"x": 16,
- "y": 19
+ "y": 20
},
"hideTimeOverride": true,
"id": 15,
@@ -1798,7 +1799,7 @@
"h": 2,
"w": 4,
"x": 20,
- "y": 19
+ "y": 20
},
"hideTimeOverride": true,
"id": 325,
@@ -1876,7 +1877,7 @@
"h": 4,
"w": 3,
"x": 0,
- "y": 21
+ "y": 22
},
"id": 20,
"links": [],
@@ -1951,7 +1952,7 @@
"h": 4,
"w": 3,
"x": 3,
- "y": 21
+ "y": 22
},
"hideTimeOverride": false,
"id": 16,
@@ -2036,7 +2037,7 @@
"h": 4,
"w": 3,
"x": 6,
- "y": 21
+ "y": 22
},
"id": 154,
"links": [],
@@ -2094,7 +2095,7 @@
"h": 4,
"w": 5,
"x": 9,
- "y": 21
+ "y": 22
},
"id": 391,
"links": [],
@@ -2175,7 +2176,7 @@
"h": 4,
"w": 5,
"x": 14,
- "y": 21
+ "y": 22
},
"id": 392,
"links": [],
@@ -2259,7 +2260,7 @@
"h": 4,
"w": 5,
"x": 19,
- "y": 21
+ "y": 22
},
"id": 155,
"links": [],
@@ -2300,7 +2301,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 25
+ "y": 26
},
"id": 347,
"panels": [],
@@ -2332,7 +2333,7 @@
"h": 9,
"w": 8,
"x": 0,
- "y": 26
+ "y": 27
},
"id": 345,
"options": {
@@ -2424,7 +2425,7 @@
"h": 9,
"w": 8,
"x": 8,
- "y": 26
+ "y": 27
},
"id": 348,
"options": {
@@ -2516,7 +2517,7 @@
"h": 9,
"w": 8,
"x": 16,
- "y": 26
+ "y": 27
},
"id": 356,
"options": {
@@ -2627,7 +2628,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2689,7 +2691,7 @@
"h": 11,
"w": 12,
"x": 0,
- "y": 35
+ "y": 36
},
"id": 352,
"options": {
@@ -2830,7 +2832,8 @@
"mode": "absolute",
"steps": [
{
- "color": "green"
+ "color": "green",
+ "value": null
},
{
"color": "red",
@@ -2892,7 +2895,7 @@
"h": 11,
"w": 12,
"x": 12,
- "y": 35
+ "y": 36
},
"id": 398,
"options": {
@@ -3064,7 +3067,7 @@
"h": 11,
"w": 12,
"x": 0,
- "y": 46
+ "y": 47
},
"id": 351,
"options": {
@@ -3222,7 +3225,7 @@
"h": 11,
"w": 12,
"x": 12,
- "y": 46
+ "y": 47
},
"id": 372,
"options": {
@@ -3363,7 +3366,7 @@
"h": 11,
"w": 12,
"x": 0,
- "y": 57
+ "y": 58
},
"id": 350,
"options": {
@@ -3534,7 +3537,7 @@
"h": 11,
"w": 12,
"x": 12,
- "y": 57
+ "y": 58
},
"id": 353,
"options": {
@@ -3701,7 +3704,7 @@
"h": 11,
"w": 12,
"x": 0,
- "y": 68
+ "y": 69
},
"id": 373,
"options": {
@@ -3842,7 +3845,7 @@
"h": 11,
"w": 12,
"x": 12,
- "y": 68
+ "y": 69
},
"id": 396,
"options": {
@@ -4009,7 +4012,7 @@
"h": 11,
"w": 12,
"x": 0,
- "y": 79
+ "y": 80
},
"id": 354,
"options": {
@@ -4176,7 +4179,7 @@
"h": 11,
"w": 12,
"x": 12,
- "y": 79
+ "y": 80
},
"id": 355,
"options": {
@@ -4217,7 +4220,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 90
+ "y": 91
},
"id": 266,
"panels": [
@@ -7488,7 +7491,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 91
+ "y": 92
},
"id": 270,
"panels": [
@@ -12818,7 +12821,7 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 92
+ "y": 93
},
"id": 272,
"panels": [
@@ -15619,10 +15622,9 @@
},
{
"current": {
- "isNone": true,
"selected": false,
- "text": "None",
- "value": ""
+ "text": "192.168.0.10:8400",
+ "value": "192.168.0.10:8400"
},
"datasource": "sysom-prometheus",
"definition": "label_values(sysom_proc_meminfo, instance)",
@@ -15679,7 +15681,7 @@
"timezone": "browser",
"title": "sysom_base",
"uid": "rYdddlPWk",
- "version": 22,
+ "version": 24,
"weekStart": ""
}
}
\ No newline at end of file
--
Gitee
From a7a5324f17542c5c02e2f2d2fa3b35f45e6fa675 Mon Sep 17 00:00:00 2001
From: JietaoXiao
Date: Fri, 15 Dec 2023 10:40:51 +0800
Subject: [PATCH 030/176] feat(cluster_health): update default settings to
adapt non-k8s environment and change port to 7020
---
deps/2_nginx/sysom.conf | 2 +
deps/3_prometheus/init.sh | 2 +-
.../app/calculator/analyzer.py | 9 ++-
.../conf/metric_settings.py | 60 +++++--------------
sysom_server/sysom_cluster_health/config.yml | 2 +-
.../sysom_cluster_health/lib/utils.py | 12 ++--
6 files changed, 34 insertions(+), 53 deletions(-)
diff --git a/deps/2_nginx/sysom.conf b/deps/2_nginx/sysom.conf
index ad9e06ad..c0d01514 100644
--- a/deps/2_nginx/sysom.conf
+++ b/deps/2_nginx/sysom.conf
@@ -177,6 +177,8 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
+ # 7020 resvered for cluster_health
+
location /api/ {
proxy_pass http://127.0.0.1:7001;
proxy_read_timeout 180s;
diff --git a/deps/3_prometheus/init.sh b/deps/3_prometheus/init.sh
index 29e1de47..96773d2c 100644
--- a/deps/3_prometheus/init.sh
+++ b/deps/3_prometheus/init.sh
@@ -21,7 +21,7 @@ add_auto_discovery()
- job_name: "cluster_health"
metrics_path: "/metrics"
static_configs:
- - targets: ["localhost:7019"]
+ - targets: ["localhost:7020"]
EOF
popd
diff --git a/sysom_server/sysom_cluster_health/app/calculator/analyzer.py b/sysom_server/sysom_cluster_health/app/calculator/analyzer.py
index 2c6b4e88..81074b44 100644
--- a/sysom_server/sysom_cluster_health/app/calculator/analyzer.py
+++ b/sysom_server/sysom_cluster_health/app/calculator/analyzer.py
@@ -133,7 +133,9 @@ class Analyzer(Process):
value, score = metric.metric_score(pod, instance,
labels["cluster"],
self.last_end_time)
- except MetricProcessException:
+ except MetricProcessException as e:
+ logger.info(f"Calculate Metric: {metric.settings.description} "
+ f"of Pod: {pod} of Node: {instance} failed {e}")
continue
self.deliver_one_alarm(labels["cluster"], instance, pod, type,
@@ -505,7 +507,12 @@ class Analyzer(Process):
pass
def _register_task(self):
+ cluster_list = []
+
cluster_list = collect_all_clusters(self.metric_manager.metric_reader)
+ # no cluster label, we assume just one, and names it "dafault"
+ if len(cluster_list) == 0 or settings.NO_CLUSTER_LABEL is True:
+ cluster_list.append("default")
start_time = time.time()
diff --git a/sysom_server/sysom_cluster_health/conf/metric_settings.py b/sysom_server/sysom_cluster_health/conf/metric_settings.py
index b57faf9d..34ef4bf5 100644
--- a/sysom_server/sysom_cluster_health/conf/metric_settings.py
+++ b/sysom_server/sysom_cluster_health/conf/metric_settings.py
@@ -10,6 +10,8 @@ CALCULATE_INTERVAL = 30
ENABLE_MULTI_THREAD = False
# Number or thread to use if ENABLE_MULTI_THREAD enable
ANALYZER_PROCESS_NUM = 1
+# No Cluster Label in metric, assume all metric is in one cluster
+NO_CLUSTER_LABEL = True
#################################################################################
# Global Metric Collecting Settings
@@ -20,7 +22,7 @@ CLUSTER_LABEL = "cluster"
POD_LABEL = "pod"
NODE_LABEL = "instance"
NAMESPACE_LABEL = "namespace"
-POD_METRIC_TAG = "type"
+POD_METRIC_TAG = "value"
#################################################################################
# Global Metric Weights Settings
@@ -66,7 +68,7 @@ POD_METRICS = {
{
"Description": "Pod memory util", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_memory_stat", # table name
+ "metric_name": "sysom_container_memUtil", # table name
"related_value": ["usage", "limit"], # specific metric
"standard_type": 2, # 0 = non-standard(custom), 1 = already usage, 2 = (usage/total*100)
},
@@ -83,7 +85,7 @@ POD_METRICS = {
{
"Description": "Pod cpu util", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_cpu_acctstat",
+ "metric_name": "sysom_container_cpuacct_stat",
"related_value": ["total"],
"standard_type": 1,
},
@@ -100,7 +102,7 @@ POD_METRICS = {
{
"Description": "Pod sys util", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_cpu_acctstat",
+ "metric_name": "sysom_container_cpuacct_stat",
"related_value": ["system"],
"standard_type": 1,
},
@@ -114,47 +116,13 @@ POD_METRICS = {
}
}
},
- {
- "Description": "Pod ephemeral storage util",
- "Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_pod_ephemeral_storage_usage",
- "related_value": ["availableBytes", "capacityBytes"],
- "standard_type": 3,
- },
- "Score": { # settings for calculating metric score
- "weight": 0.5,
- "score": {
- "100": 70,
- "70": 80,
- "60": 90,
- "0": 100
- }
- }
- },
- {
- "Description": "Pod ephemeral storage inode util",
- "Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_pod_ephemeral_storage_usage",
- "related_value": ["inodesFree", "inodes"],
- "standard_type": 3,
- },
- "Score": { # settings for calculating metric score
- "weight": 0.5,
- "score": {
- "100": 70,
- "70": 80,
- "60": 90,
- "0": 100
- }
- }
- },
],
"LoadMetric": [
{
"Description": "Pod load average", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
"metric_name": "sysom_container_proc_stat",
- "related_value": ["load1min"],
+ "related_value": ["r_load1min"],
"standard_type": 1,
},
"Score": { # settings for calculating metric score
@@ -172,7 +140,7 @@ POD_METRICS = {
{
"Description": "Pod memory reclaim latency", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_memory_cdrcm_latency",
+ "metric_name": "sysom_container_memdrcm_latency",
# 延时区间需要按从小到达填写
"related_value": ["memDrcm_lat_10to100ms", "memDrcm_lat_100to500ms", "memDrcm_lat_500to1000ms",
"memDrcm_lat_1000ms"],
@@ -191,7 +159,7 @@ POD_METRICS = {
{
"Description": "Pod memory compact latency", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_memory_cpt_latency",
+ "metric_name": "sysom_container_memmcmp_latency",
# 延时区间需要按从小到达填写
"related_value": ["memDcmp_lat_10to100ms", "memDcmp_lat_100to500ms", "memDcmp_lat_500to1000ms",
"memDcmp_lat_1000ms"],
@@ -228,7 +196,7 @@ POD_METRICS = {
{
"Description": "Pod memory fail count", # description of the metric
"Collect": { # settings for collecting and preprocessing metric
- "metric_name": "sysom_container_memory_failcnt",
+ "metric_name": "sysom_container_memfail_cnt",
"related_value": ["fail_cnt"],
"standard_type": 1,
},
@@ -296,7 +264,7 @@ NODE_METRICS = {
"Collect": { # settings for collecting and preprocessing metric
"metric_name": "sysom_proc_meminfo", # table name
"related_value": ["MemAvailable", "MemTotal"], # specific metric
- "node_tag_name": "type",
+ "node_tag_name": "value",
"standard_type": 3, # 0 = non-standard, 1 = already usage, 2 = (usage/total*100)
},
"Score": { # settings for calculating metric score
@@ -391,7 +359,7 @@ NODE_METRICS = {
"Collect": { # settings for collecting and preprocessing metric
"metric_name": "sysom_proc_loadavg",
"related_value": ["load1"],
- "node_tag_name": "type",
+ "node_tag_name": "value",
"standard_type": 0,
"filename": "node_load_avg",
},
@@ -412,7 +380,7 @@ NODE_METRICS = {
"Collect": {
"metric_name": "sysom_cpu_dist",
"related_value": ["ms10","ms100","s1"],
- "node_tag_name": "type",
+ "node_tag_name": "value",
"standard_type": 2,
},
"Score": {
@@ -432,7 +400,7 @@ NODE_METRICS = {
"Collect": { # settings for collecting and preprocessing metric
"metric_name": "sysom_proc_vmstat",
"related_value": ["oom_kill"],
- "node_tag_name": "type",
+ "node_tag_name": "value",
"standard_type": 1,
},
"Score": { # settings for calculating metric score
diff --git a/sysom_server/sysom_cluster_health/config.yml b/sysom_server/sysom_cluster_health/config.yml
index 006aa9c7..44504ac9 100644
--- a/sysom_server/sysom_cluster_health/config.yml
+++ b/sysom_server/sysom_cluster_health/config.yml
@@ -13,7 +13,7 @@ sysom_service:
protocol: http
host: 127.0.0.1
bind: 127.0.0.1
- port: 7019
+ port: 7020
framework:
gcache:
protocol: redis
diff --git a/sysom_server/sysom_cluster_health/lib/utils.py b/sysom_server/sysom_cluster_health/lib/utils.py
index a7d118d6..91a535f1 100644
--- a/sysom_server/sysom_cluster_health/lib/utils.py
+++ b/sysom_server/sysom_cluster_health/lib/utils.py
@@ -12,11 +12,11 @@ NAMESPACE_LABELS = settings.NAMESPACE_LABEL
def collect_all_clusters(metric_reader: MetricReader) -> List[str]:
- instance_list = []
+ cluster_list = []
res = metric_reader.get_label_values("cluster")
if len(res.data) <= 0:
logger.error("Collect all cluster failed!")
- return instance_list
+ return cluster_list
return [item for item in res.data]
@@ -38,11 +38,15 @@ def collect_instances_of_cluster(cluster_id: str, metric_reader: MetricReader,
"""
instances_list = []
+
task = RangeQueryTask(INSTANCES_VRAIABLE,
start_time=time.time() - interval,
end_time=time.time()) \
- .append_equal_filter("cluster", cluster_id) \
- .append_equal_filter("mode", "total")
+ .append_equal_filter("mode", "total") \
+
+ if cluster_id != "default":
+ task.append_equal_filter("cluster", cluster_id)
+
node_metric_res = metric_reader.range_query([task])
if len(node_metric_res.data) <= 0:
logger.error(
--
Gitee
From 474ff929021c8db382c1ec6a62bc297e2739a064 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Tue, 19 Dec 2023 17:30:06 +0800
Subject: [PATCH 031/176] fix(cec): Do not log cec message value
---
environment/1_sdk/cec_redis/redis_producer.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/environment/1_sdk/cec_redis/redis_producer.py b/environment/1_sdk/cec_redis/redis_producer.py
index adc2dbe4..137840e2 100644
--- a/environment/1_sdk/cec_redis/redis_producer.py
+++ b/environment/1_sdk/cec_redis/redis_producer.py
@@ -151,8 +151,7 @@ class RedisProducer(Producer, ClientBase):
f"Topic ({topic_name}) not exists.")
else:
logger.info(
- f"{self} produce one message '{event_id}'=>"
- f"{message_value} successfully."
+ f"{self} produce one message '{event_id}'"
)
if callback is not None:
--
Gitee
From 3f5b610d21971e82a6c276bb30134dd76bf500e6 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Thu, 21 Dec 2023 15:57:44 +0800
Subject: [PATCH 032/176] fix(web.diagnose): Detail page need to used v2
localse.json
---
sysom_web/src/pages/diagnose/detail/index.jsx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/sysom_web/src/pages/diagnose/detail/index.jsx b/sysom_web/src/pages/diagnose/detail/index.jsx
index 0947ed53..d957bd25 100644
--- a/sysom_web/src/pages/diagnose/detail/index.jsx
+++ b/sysom_web/src/pages/diagnose/detail/index.jsx
@@ -4,6 +4,7 @@ import { request } from 'umi';
import Dashboard from '../components/Dashboard';
import { getTask } from '../service'
import _ from "lodash";
+import menu from '@/locales/en-US/menu';
const DiagnoseDetai = (props) => {
const [pannelConfig, setPannelConfig] = useState({});
@@ -15,12 +16,13 @@ const DiagnoseDetai = (props) => {
const taskResult = await getTask(taskId);
const service_name = taskResult.service_name;
- const localesConfig = await request(`/resource/diagnose/v1/locales.json`)
- const dashboards = localesConfig.dashboard;
+ const localesConfig = await request(`/resource/diagnose/v2/locales.json`)
+ const menus = localesConfig.menus;
let pannelJsonUrl = ""
- for (let k in dashboards) {
- if (k.endsWith(service_name)) {
- pannelJsonUrl = `/resource/diagnose/v1${(k.split("menu.diagnose")[1].split(".")).join("/")}.json`
+ for (let i = 0; i < menus.length; i++) {
+ let menu = menus[i];
+ if (menu.endsWith(service_name)) {
+ pannelJsonUrl = `/resource/diagnose/v1${(menu.split("menu.diagnose")[1].split(".")).join("/")}.json`
break
}
}
--
Gitee
From 6257f9ce7a7521e122aec3e63aa0d5b3543ab40b Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Thu, 21 Dec 2023 16:51:38 +0800
Subject: [PATCH 033/176] fix(web.appobserver): ntopo jump to mysql failed
---
sysom_web/src/pages/app_observable/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysom_web/src/pages/app_observable/index.js b/sysom_web/src/pages/app_observable/index.js
index 207b6608..fe85e164 100644
--- a/sysom_web/src/pages/app_observable/index.js
+++ b/sysom_web/src/pages/app_observable/index.js
@@ -19,7 +19,7 @@ const AppObservable = (props) => {
// Get config
let urlslice = props.match.url.split("/");
urlslice.splice(2, 0, "v1");
- request(`/resource${urlslice.join("/")}.json`)
+ request(`/resource${urlslice.join("/").toLowerCase()}.json`)
.then((res) => {
console.log("setPannelConfig", res);
setPannelConfig(res);
--
Gitee
From f139fa3df6c5612e3f76501b7ba492b63c470914 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Fri, 22 Dec 2023 13:43:30 +0800
Subject: [PATCH 034/176] feat(web.diagnosis): Table pannel support custom
columns
---
.../resource/diagnose/v2/cpu/cpuhigh.json | 35 +++++
.../resource/diagnose/v2/cpu/loadtask.json | 86 +++++++++++
.../public/resource/diagnose/v2/cpu/readme | 0
.../resource/diagnose/v2/cpu/schedmoni.json | 49 +++++++
.../resource/diagnose/v2/cpu/taskprofile.json | 29 ++++
.../resource/diagnose/v2/custom/command.json | 29 ++++
.../resource/diagnose/v2/custom/rca.json | 37 +++++
.../resource/diagnose/v2/link/jruntime.json | 61 ++++++++
.../resource/diagnose/v2/link/procdiag.json | 38 +++++
.../resource/diagnose/v2/link/rtdelay.json | 46 ++++++
.../public/resource/diagnose/v2/locales.json | 21 ++-
.../diagnose/v2/memory/clustermem.json | 64 ++++++++
.../diagnose/v2/memory/filecache.json | 41 ++++++
.../resource/diagnose/v2/memory/memgraph.json | 95 ++++++++++++
.../resource/diagnose/v2/memory/oomcheck.json | 54 +++++++
.../resource/diagnose/v2/multichannel.json | 20 +++
.../resource/diagnose/v2/net/jitter.json | 93 ++++++++++++
.../resource/diagnose/v2/net/packetdrop.json | 41 ++++++
.../resource/diagnose/v2/net/pingtrace.json | 138 ++++++++++++++++++
.../public/resource/diagnose/v2/net/readme | 1 +
.../resource/diagnose/v2/net/retran.json | 75 ++++++++++
.../public/resource/diagnose/v2/ossre.json | 115 +++++++++++++++
.../public/resource/diagnose/v2/rca/.gitkeep | 0
.../diagnose/v2/storage/iodiagnose.json | 28 ++++
.../diagnose/v2/storage/iofsstat.json | 60 ++++++++
.../resource/diagnose/v2/storage/iohang.json | 71 +++++++++
.../diagnose/v2/storage/iolatency.json | 120 +++++++++++++++
.../resource/diagnose/v2/storage/readme | 1 +
.../pages/diagnose/components/TablePannel.jsx | 65 ++++++---
sysom_web/src/pages/diagnose/detail/index.jsx | 2 +-
sysom_web/src/pages/diagnose/diagnose.jsx | 4 +-
31 files changed, 1493 insertions(+), 26 deletions(-)
create mode 100644 sysom_web/public/resource/diagnose/v2/cpu/cpuhigh.json
create mode 100644 sysom_web/public/resource/diagnose/v2/cpu/loadtask.json
create mode 100644 sysom_web/public/resource/diagnose/v2/cpu/readme
create mode 100644 sysom_web/public/resource/diagnose/v2/cpu/schedmoni.json
create mode 100644 sysom_web/public/resource/diagnose/v2/cpu/taskprofile.json
create mode 100644 sysom_web/public/resource/diagnose/v2/custom/command.json
create mode 100644 sysom_web/public/resource/diagnose/v2/custom/rca.json
create mode 100644 sysom_web/public/resource/diagnose/v2/link/jruntime.json
create mode 100644 sysom_web/public/resource/diagnose/v2/link/procdiag.json
create mode 100644 sysom_web/public/resource/diagnose/v2/link/rtdelay.json
create mode 100644 sysom_web/public/resource/diagnose/v2/memory/clustermem.json
create mode 100644 sysom_web/public/resource/diagnose/v2/memory/filecache.json
create mode 100644 sysom_web/public/resource/diagnose/v2/memory/memgraph.json
create mode 100644 sysom_web/public/resource/diagnose/v2/memory/oomcheck.json
create mode 100644 sysom_web/public/resource/diagnose/v2/multichannel.json
create mode 100644 sysom_web/public/resource/diagnose/v2/net/jitter.json
create mode 100644 sysom_web/public/resource/diagnose/v2/net/packetdrop.json
create mode 100644 sysom_web/public/resource/diagnose/v2/net/pingtrace.json
create mode 100644 sysom_web/public/resource/diagnose/v2/net/readme
create mode 100644 sysom_web/public/resource/diagnose/v2/net/retran.json
create mode 100644 sysom_web/public/resource/diagnose/v2/ossre.json
create mode 100644 sysom_web/public/resource/diagnose/v2/rca/.gitkeep
create mode 100644 sysom_web/public/resource/diagnose/v2/storage/iodiagnose.json
create mode 100644 sysom_web/public/resource/diagnose/v2/storage/iofsstat.json
create mode 100644 sysom_web/public/resource/diagnose/v2/storage/iohang.json
create mode 100644 sysom_web/public/resource/diagnose/v2/storage/iolatency.json
create mode 100644 sysom_web/public/resource/diagnose/v2/storage/readme
diff --git a/sysom_web/public/resource/diagnose/v2/cpu/cpuhigh.json b/sysom_web/public/resource/diagnose/v2/cpu/cpuhigh.json
new file mode 100644
index 00000000..d0d4b403
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/cpu/cpuhigh.json
@@ -0,0 +1,35 @@
+{
+ "servicename": "cpuhigh",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "moment",
+ "initialValue": "2023-08-12 00:00:00",
+ "label": "时间",
+ "tooltips": "CPU冲高发生的时间点"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "cpuhighEvent",
+ "type": "stat",
+ "title": "Event overview",
+ "datasource": "cpuhighEventSummary"
+ },
+ {
+ "key": "cpuhighTable",
+ "type": "table",
+ "title": "cpu high Details",
+ "datasource": "cpuhighTable"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/cpu/loadtask.json b/sysom_web/public/resource/diagnose/v2/cpu/loadtask.json
new file mode 100644
index 00000000..7d4fd02f
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/cpu/loadtask.json
@@ -0,0 +1,86 @@
+{
+ "servicename": "loadtask",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "事件总览",
+ "type": "stat",
+ "title": "事件总览",
+ "datasource": "dataresult",
+ "fieldConfig": {
+ "mappings": [
+ {
+ "type": "value",
+ "options": {
+ "true": {
+ "color": "red",
+ "text": "异常"
+ },
+ "false": {
+ "color": "green",
+ "text": "正常"
+ }
+ }
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "red",
+ "value": 20
+ },
+ {
+ "color": "green",
+ "value": 0
+ }
+ ]
+ },
+ "unit": ""
+ }
+ },
+ {
+ "key": "pieRow",
+ "type": "row",
+ "title": "测试行",
+ "datasource": "",
+ "children": [
+ {
+ "key": "alltasks",
+ "type": "piechart",
+ "title": "R/D状态进程数量",
+ "datasource": "datataskcount"
+ },
+ {
+ "key": "dtasks",
+ "type": "piechart",
+ "title": "D状态负载影响度",
+ "datasource": "datauninterruptload"
+ },
+ {
+ "key": "rtasks",
+ "type": "piechart",
+ "title": "R状态负载影响度",
+ "datasource": "datarunningload"
+ }
+ ]
+ },
+ {
+ "key": "火焰图",
+ "type": "svg",
+ "title": "调度火焰图",
+ "datasource": "dataflamegraph"
+ }
+ ]
+
+}
diff --git a/sysom_web/public/resource/diagnose/v2/cpu/readme b/sysom_web/public/resource/diagnose/v2/cpu/readme
new file mode 100644
index 00000000..e69de29b
diff --git a/sysom_web/public/resource/diagnose/v2/cpu/schedmoni.json b/sysom_web/public/resource/diagnose/v2/cpu/schedmoni.json
new file mode 100644
index 00000000..9ea76e47
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/cpu/schedmoni.json
@@ -0,0 +1,49 @@
+{
+ "servicename": "schedmoni",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "20",
+ "label": "诊断时间",
+ "tooltips": "本次的期望的诊断时间,默认20秒"
+ },
+ {
+ "type": "text",
+ "name": "threshold",
+ "initialValue": "20",
+ "label": "诊断阈值",
+ "tooltips": "延迟的阈值,超过这个阈值就记录,默认20ms"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "jitterEvent",
+ "type": "stat",
+ "title": "Event overview",
+ "datasource": "jitterEventSummary"
+ },
+ {
+ "key": "timeseriesTable",
+ "type": "timeseries",
+ "title": "Timeline Diagram",
+ "datasource": "jitterTimeSeries"
+ },
+ {
+ "key": "jitterTable",
+ "type": "table",
+ "title": "Scheduling Jitter Details",
+ "datasource": "jitterTable"
+ }
+ ]
+
+}
diff --git a/sysom_web/public/resource/diagnose/v2/cpu/taskprofile.json b/sysom_web/public/resource/diagnose/v2/cpu/taskprofile.json
new file mode 100644
index 00000000..48c259cf
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/cpu/taskprofile.json
@@ -0,0 +1,29 @@
+{
+ "servicename": "taskprofile",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP,我们将在会这台机器内部发起应用占用cpu统计"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "5",
+ "label": "诊断时长",
+ "tooltips": "诊断时长,也是各应用占用cpu统计周期,单位分,建议不超过10分钟"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "appProfile",
+ "type": "table",
+ "title": "App profile result",
+ "datasource": "appProfile"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/custom/command.json b/sysom_web/public/resource/diagnose/v2/custom/command.json
new file mode 100644
index 00000000..76503843
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/custom/command.json
@@ -0,0 +1,29 @@
+{
+ "servicename": "command",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ },
+ {
+ "type": "text",
+ "name": "command",
+ "initialValue": "",
+ "label": "命令",
+ "tooltips": "请输入你需要执行的命令"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "CommandResult",
+ "type": "stat",
+ "title": "Command Result:",
+ "datasource": "CommandResult"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/custom/rca.json b/sysom_web/public/resource/diagnose/v2/custom/rca.json
new file mode 100644
index 00000000..96560aef
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/custom/rca.json
@@ -0,0 +1,37 @@
+{
+ "servicename": "rca",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ },
+ {
+ "type": "text",
+ "name": "base_item",
+ "initialValue": "test_RT",
+ "label": "异常指标",
+ "tooltips": "异常指标的名字,如用户RT"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "",
+ "label": "异常时刻",
+ "tooltips": "请输入异常时间点,格式:2023-07-08 12:23:33"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "rca_result",
+ "type": "markdown",
+ "title": "",
+ "datasource": "RcaResult"
+ }
+ ]
+}
+
diff --git a/sysom_web/public/resource/diagnose/v2/link/jruntime.json b/sysom_web/public/resource/diagnose/v2/link/jruntime.json
new file mode 100644
index 00000000..67f1b3ef
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/link/jruntime.json
@@ -0,0 +1,61 @@
+{
+ "servicename": "jruntime",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ },
+ {
+ "type": "text",
+ "name": "nums",
+ "initialValue": "3",
+ "label": "进程数量",
+ "tooltips": "请输入你需要诊断的进程数量,"
+ },
+ {
+ "type": "text",
+ "name": "pids",
+ "initialValue": "",
+ "label": "进程列表",
+ "tooltips": "进程列表,要用逗号隔开,进程数量和进程列表仅有一个参数有效"
+ },
+ {
+ "type": "select",
+ "name": "global",
+ "initialValue": "on",
+ "label": "全局热点",
+ "tooltips": "是否需要全局热点",
+ "options": [
+ {
+ "value": "on",
+ "label": "开启"
+ },
+ {
+ "value": "off",
+ "label": "关闭"
+ }
+ ]
+ }
+
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "jruntime_data",
+ "type": "markdown",
+ "title": "",
+ "datasource": "jruntime_data"
+ },
+ {
+ "key": "jruntime_set",
+ "type": "svg",
+ "title": "运行时诊断结果",
+ "datasource": "svgdata"
+ }
+ ]
+}
+
diff --git a/sysom_web/public/resource/diagnose/v2/link/procdiag.json b/sysom_web/public/resource/diagnose/v2/link/procdiag.json
new file mode 100644
index 00000000..8d39c9be
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/link/procdiag.json
@@ -0,0 +1,38 @@
+{
+ "servicename": "procdiag",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ },
+ {
+ "type": "text",
+ "name": "ipport",
+ "initialValue": "",
+ "label": "IP:Port",
+ "tooltips": "目标IP:端口"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "60",
+ "label": "诊断时长",
+ "tooltips": "输入诊断时间长度,单位秒"
+ }
+
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "progdiag_data",
+ "type": "markdown",
+ "title": "应用诊断",
+ "datasource": "procdiag_data"
+ }
+ ]
+}
+
diff --git a/sysom_web/public/resource/diagnose/v2/link/rtdelay.json b/sysom_web/public/resource/diagnose/v2/link/rtdelay.json
new file mode 100644
index 00000000..1ab6b88e
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/link/rtdelay.json
@@ -0,0 +1,46 @@
+{
+ "servicename": "rtdelay",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ },
+ {
+ "type": "text",
+ "name": "pid",
+ "initialValue": "",
+ "label": "应用进程号",
+ "tooltips": "请输入你需要诊断的应用进程号"
+ },
+ {
+ "type": "text",
+ "name": "server_pid",
+ "initialValue": "-1",
+ "label": "服务端进程号",
+ "tooltips": "请输入该应用访问的服务端进程号(-1为不跟踪服务端)"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "30",
+ "label": "诊断时长",
+ "tooltips": "请输入你需要诊断时长,单位秒"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "rt_request_set",
+ "type": "table",
+ "title": "请求RT时延分析",
+ "datasource": "request_set",
+ "tooltips": "时间单位为微秒"
+ }
+ ]
+}
+
+
diff --git a/sysom_web/public/resource/diagnose/v2/locales.json b/sysom_web/public/resource/diagnose/v2/locales.json
index 3e036ca4..a7ee7b52 100644
--- a/sysom_web/public/resource/diagnose/v2/locales.json
+++ b/sysom_web/public/resource/diagnose/v2/locales.json
@@ -19,7 +19,8 @@
"menu.diagnose.link.procdiag",
"menu.diagnose.link.jruntime",
"menu.diagnose.custom.command",
- "menu.diagnose.custom.rca"
+ "menu.diagnose.custom.rca",
+ "menu.diagnose.ossre"
],
"locales": {
"zh-CN": {
@@ -47,7 +48,14 @@
"menu.diagnose.link.jruntime": "java运行时分析",
"menu.diagnose.link.procdiag": "应用抖动诊断",
"menu.diagnose.custom.command": "命令诊断",
- "menu.diagnose.custom.rca": "指标异常分析"
+ "menu.diagnose.custom.rca": "指标异常分析",
+ "menu.diagnose.ossre":"系统健康检查",
+
+ "pages.diagnose.ossre.ossre_result.inspect_items": "检查项目",
+ "pages.diagnose.ossre.ossre_result.status": "状态",
+ "pages.diagnose.ossre.ossre_result.abnormal_count": "异常数",
+ "pages.diagnose.ossre.ossre_result.inspect_result": "检查结果",
+ "pages.diagnose.ossre.ossre_result.options": "操作"
},
"en-US": {
"menu.diagnose.memory": "Memory Diagnosis Center",
@@ -74,7 +82,14 @@
"menu.diagnose.link.jruntime": "Java Runtime Analysis",
"menu.diagnose.link.procdiag": "Application jitter Diagnosis",
"menu.diagnose.custom.command": "Command Diagnosis",
- "menu.diagnose.custom.rca": "Metric Exception Analysis"
+ "menu.diagnose.custom.rca": "Metric Exception Analysis",
+ "menu.diagnose.ossre":"System Diagnosis",
+
+ "pages.diagnose.ossre.ossre_result.inspect_items": "Inspect Items",
+ "pages.diagnose.ossre.ossre_result.status": "Status",
+ "pages.diagnose.ossre.ossre_result.abnormal_count": "Abnormal Count",
+ "pages.diagnose.ossre.ossre_result.inspect_result": "Inspect Result",
+ "pages.diagnose.ossre.ossre_result.options": "Options"
}
}
}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/memory/clustermem.json b/sysom_web/public/resource/diagnose/v2/memory/clustermem.json
new file mode 100644
index 00000000..a2cd7d94
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/memory/clustermem.json
@@ -0,0 +1,64 @@
+{
+ "servicename": "clustermem",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将会发起节点内存异常诊断"
+ },
+ {
+ "type": "text",
+ "name": "pod_name",
+ "initialValue": "",
+ "label": "Pod",
+ "tooltips": "请输入你要诊断的pod名字,我们将会发起pod内存异常诊断"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "",
+ "label": "异常时刻",
+ "tooltips": "请输入异常时间点,格式:2023-07-08 12:23:33"
+ },
+ {
+ "type": "text",
+ "name": "diagnosis_type",
+ "initialValue": "",
+ "label": "诊断类型",
+ "tooltips": "请输入诊断类型,内存高诊断/内存延时诊断"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "clustermem",
+ "type": "markdown",
+ "title": "诊断结果",
+ "datasource": "ClustermemResult"
+ },
+ {
+ "key": "mem_usage",
+ "type": "stat",
+ "title": "节点/Pod已用内存构成",
+ "datasource": "UsageResult",
+ "fieldConfig": {
+ "unit": "%"
+ }
+ },
+ {
+ "key": "podmem",
+ "type": "table",
+ "title": "缓存排序",
+ "datasource": "podmem",
+ "fieldConfig": {
+ "unit": "KB"
+ },
+ "tableConfig": {
+ "enableSortColumn": ["文件Cached大小"]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/memory/filecache.json b/sysom_web/public/resource/diagnose/v2/memory/filecache.json
new file mode 100644
index 00000000..6462917d
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/memory/filecache.json
@@ -0,0 +1,41 @@
+{
+ "servicename": "filecache",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "value",
+ "initialValue": "",
+ "label": "容器",
+ "tooltips": "请输入你要诊断的容器ID,Pod名,cgroup"
+ },
+ {
+ "type": "select",
+ "name": "type",
+ "initialValue": "all",
+ "label": "诊断类型",
+ "tooltips": "请输入需要诊断的类型(容器,POD,cgroup, host, all(所有容器))",
+ "options":[{"value":"pod", "label":"pod"}, {"value":"container", "label":"container"},{"value":"cgroup", "label":"cgroup"}, {"value":"host", "label":"host"},{"value":"all", "label":"all"}]
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "podmem",
+ "type": "table",
+ "title": "缓存排序",
+ "datasource": "podmem",
+ "fieldConfig": {
+ "unit": "KB"
+ }
+ }
+ ]
+
+}
diff --git a/sysom_web/public/resource/diagnose/v2/memory/memgraph.json b/sysom_web/public/resource/diagnose/v2/memory/memgraph.json
new file mode 100644
index 00000000..83a28d31
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/memory/memgraph.json
@@ -0,0 +1,95 @@
+{
+ "servicename": "memgraph",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "memEvent",
+ "type": "stat",
+ "title": "MemEvent",
+ "datasource": "dataMemEvent",
+ "fieldConfig": {
+ "mappings": [
+ {
+ "type": "value",
+ "options": {
+ "OK": {
+ "color": "green",
+ "index": 0
+ },
+ "NG": {
+ "color": "red",
+ "index": 1
+ }
+ }
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "red",
+ "value": 5
+ },
+ {
+ "color": "green",
+ "value": 0
+ }
+ ]
+ },
+ "unit": "%"
+ }
+ },
+ {
+ "key": "pieRow",
+ "type": "row",
+ "title": "测试行",
+ "datasource": "",
+ "children": [
+ {
+ "key": "memOverView",
+ "type": "piechart",
+ "title": "MemOverView",
+ "datasource": "dataMemOverView"
+ },
+ {
+ "key": "kerMem",
+ "type": "piechart",
+ "title": "KernelMem",
+ "datasource": "dataKerMem"
+ },
+ {
+ "key": "userMem",
+ "type": "piechart",
+ "title": "UserMem",
+ "datasource": "dataUserMem"
+ }
+ ]
+ },
+ {
+ "key": "procMemList",
+ "type": "table",
+ "title": "TaskTop",
+ "datasource": "dataProcMemList"
+ },
+ {
+ "key": "cacheList",
+ "type": "table",
+ "title": "CacheTop",
+ "datasource": "dataCacheList",
+ "fieldConfig": {
+ "unit": "KB"
+ }
+ }
+ ]
+
+}
diff --git a/sysom_web/public/resource/diagnose/v2/memory/oomcheck.json b/sysom_web/public/resource/diagnose/v2/memory/oomcheck.json
new file mode 100644
index 00000000..3ba2c89d
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/memory/oomcheck.json
@@ -0,0 +1,54 @@
+{
+ "servicename": "oomcheck",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "",
+ "label": "诊断时间",
+ "tooltips": "请输入需要诊断OOM的时间点,默认为最近一次"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "oomAnalysis",
+ "type": "stat",
+ "title": "OOM Analysis",
+ "datasource": "oomAnalysis"
+ },
+ {
+ "key": "oomEvent",
+ "type": "stat",
+ "title": "OOM Diagnose Result",
+ "datasource": "oomResult"
+ },
+ {
+ "key": "oomDetail",
+ "type": "table",
+ "title": "OOM Diagnose Detail",
+ "datasource": "oomDetail",
+ "fieldConfig": {
+ "unit": "KB"
+ }
+ },
+ {
+ "key": "oomTask",
+ "type": "table",
+ "title": "OOM Tasks Detail",
+ "datasource": "oomTask",
+ "fieldConfig": {
+ "unit": "KB"
+ }
+ }
+ ]
+
+}
diff --git a/sysom_web/public/resource/diagnose/v2/multichannel.json b/sysom_web/public/resource/diagnose/v2/multichannel.json
new file mode 100644
index 00000000..b956ca6a
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/multichannel.json
@@ -0,0 +1,20 @@
+{
+ "version": 1.0,
+ "channels": [
+ {
+ "name": "ssh",
+ "label": "SSH通道",
+ "extra_params": {
+ "*": [
+ {
+ "type": "text",
+ "name": "channel",
+ "initialValue": "ssh",
+ "label": "通道类型",
+ "disabled": true
+ }
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/net/jitter.json b/sysom_web/public/resource/diagnose/v2/net/jitter.json
new file mode 100644
index 00000000..e0fe9503
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/net/jitter.json
@@ -0,0 +1,93 @@
+{
+ "servicename": "jitter",
+ "version": 1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "10",
+ "label": "运行时间",
+ "tooltips": "请输入你要诊断的时间,单位秒"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "flowchart",
+ "type": "flow",
+ "title": "发送端报文路径",
+ "flowconfigs": {
+ "nodes": [
+ {
+ "id": "send",
+ "x": "40",
+ "y": "40"
+ },
+ {
+ "id": "out",
+ "x": "340",
+ "y": "40"
+ },
+ {
+ "id" : "recv",
+ "x": "640",
+ "y": "40"
+ }
+ ],
+ "edges": [
+ {
+ "source": "send",
+ "target": {
+ "cell": "out",
+ "port": "right"
+ }
+ },
+ {
+ "source": "out",
+ "target": {
+ "cell": "recv",
+ "port": "right"
+ }
+ }
+ ]
+ },
+ "datasource": "senderflow"
+ },
+ {
+ "key": "flowchart",
+ "type": "flow",
+ "title": "接收端报文路径",
+ "flowconfigs": {
+ "nodes": [
+ {
+ "id": "recv",
+ "x": "40",
+ "y": "40"
+ },
+ {
+ "id" : "send",
+ "x": "40",
+ "y": "200"
+ }
+ ],
+ "edges": [
+ {
+ "source": "recv",
+ "target": {
+ "cell": "send",
+ "port": "top"
+ }
+ }
+ ]
+ },
+ "datasource": "receiverflow"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/net/packetdrop.json b/sysom_web/public/resource/diagnose/v2/net/packetdrop.json
new file mode 100644
index 00000000..eaac1155
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/net/packetdrop.json
@@ -0,0 +1,41 @@
+{
+ "servicename": "packetdrop",
+ "version": 1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "10",
+ "label": "运行时间",
+ "tooltips": "请输入你要诊断的时间,单位秒"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "packetDropEvent",
+ "type": "stat",
+ "title": "packetDrop overview",
+ "datasource": "packetDropSummary"
+ },
+ {
+ "key": "packetDropAnalysis",
+ "type": "table",
+ "title": "丢包根因分析",
+ "datasource": "packetDropAnalysis"
+ },
+ {
+ "key": "packetDropList",
+ "type": "table",
+ "title": "丢包详情列表",
+ "datasource": "packetDropList"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/net/pingtrace.json b/sysom_web/public/resource/diagnose/v2/net/pingtrace.json
new file mode 100644
index 00000000..d1336128
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/net/pingtrace.json
@@ -0,0 +1,138 @@
+{
+ "servicename": "pingtrace",
+ "version": 1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "origin_instance",
+ "initialValue": "",
+ "label": "源实例ip",
+ "tooltips": "请输入你要诊断的源实例IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "target_instance",
+ "initialValue": "",
+ "label": "目标实例ip",
+ "tooltips": "请输入你要诊断的目标实例IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "pkg_num",
+ "initialValue": "100",
+ "label": "追踪包数",
+ "tooltips": "请输入你要追踪的包数"
+ },
+ {
+ "type": "text",
+ "name": "time_gap",
+ "initialValue": "1000",
+ "label": "间隔毫秒数",
+ "tooltips": "请输入发包间隔"
+ },
+ {
+ "type": "select",
+ "name": "type",
+ "initialValue": "icmp",
+ "label": "报文协议",
+ "tooltips": "请输入报文协议(icmp,tcp,udp)",
+ "options":[{"value":"icmp", "label":"icmp"}, {"value":"tcp", "label":"tcp"},{"value":"udp", "label":"udp"}]
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "pingtraceLatency",
+ "type": "flow",
+ "title": "Overall delay distribution",
+ "flowconfigs": {
+ "layout":{
+ "type": "grid",
+ "rows": "2",
+ "cols": "4"
+ },
+ "nodes": [
+ {
+ "id": "l_tx_kern",
+ "tips": "The time delay of the transmitting path in client OS kernel(unit: us)" ,
+ "col": 0,
+ "row": 0
+ },
+ {
+ "id": "l_tx_qdisc",
+ "tips":"The time delay of client OS kernel qdisc(unit: us)",
+ "col": 1,
+ "row": 0
+ },
+ {
+ "id": "l_tx_outlink",
+ "tips": "The time delay of outter link(unit: us)",
+ "col": 2,
+ "row": 0
+ },
+ {
+ "id": "r_tx_kern",
+ "tips": "The time delay of the transmitting path in server OS kernel(unit: us)",
+ "col": 3,
+ "row": 0
+ },
+ {
+ "id": "l_rx_inlink",
+ "tips": "The time delay of inner link(unit: us)",
+ "col": 3,
+ "row": 1
+ },
+ {
+ "id": "l_rx_kern",
+ "tips": "The time delay of the receiving path in client OS kernel(unit: us)",
+ "col": 2,
+ "row": 1
+ },
+ {
+ "id": "l_rx_task_waking",
+ "tips": "The time delay of pingtrace task wakeup(unit: us)",
+ "col": 1,
+ "row": 1
+ },
+ {
+ "id": "l_rx_task_queue",
+ "tips": "The time delay of pingtrace task queue(unit: us)",
+ "col": 0,
+ "row": 1
+ }
+ ],
+ "edges": [
+ {
+ "source": "l_tx_kern",
+ "target": "l_tx_qdisc"
+ },
+ {
+ "source": "l_tx_qdisc",
+ "target": "l_tx_outlink"
+ },
+ {
+ "source": "l_tx_outlink",
+ "target": "r_tx_kern"
+ },
+ {
+ "source": "r_tx_kern",
+ "target": "l_rx_inlink"
+ },
+ {
+ "source": "l_rx_inlink",
+ "target": "l_rx_kern"
+ },
+ {
+ "source": "l_rx_kern",
+ "target": "l_rx_task_waking"
+ },
+ {
+ "source": "l_rx_task_waking",
+ "target": "l_rx_task_queue"
+ }
+ ]
+ },
+ "datasource": "pingtraceFlow"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/net/readme b/sysom_web/public/resource/diagnose/v2/net/readme
new file mode 100644
index 00000000..1080d80e
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/net/readme
@@ -0,0 +1 @@
+请在此文件夹添加网络相关的面板配置文件。
diff --git a/sysom_web/public/resource/diagnose/v2/net/retran.json b/sysom_web/public/resource/diagnose/v2/net/retran.json
new file mode 100644
index 00000000..31206f18
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/net/retran.json
@@ -0,0 +1,75 @@
+{
+ "servicename": "retran",
+ "version": 1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP, 我们将在会这台机器内部发起SysAK诊断"
+ },
+ {
+ "type": "text",
+ "name": "time",
+ "initialValue": "10",
+ "label": "运行时间",
+ "tooltips": "请输入你要诊断的时间,单位秒"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "retranSummary",
+ "type": "stat",
+ "title": "retran overview",
+ "datasource": "retranSummary"
+ },
+ {
+ "key": "portDistribution",
+ "type": "row",
+ "title": "port distribution",
+ "datasource": "portDistribution",
+ "children": [
+ {
+ "key": "sportDistribution",
+ "type": "piechart",
+ "title": "sourcePortDistribution",
+ "datasource": "sourcePortDistribution"
+ },
+ {
+ "key": "destPortDistribution",
+ "type": "piechart",
+ "title": "destPortDistribution",
+ "datasource": "destPortDistribution"
+ }
+ ]
+ },
+ {
+ "key": "ipDistribution",
+ "type": "row",
+ "title": "ip distribution",
+ "datasource": "ipDistribution",
+ "children": [
+ {
+ "key": "sourceIpDistribution",
+ "type": "piechart",
+ "title": "sourceIpDistribution",
+ "datasource": "sourceIpDistribution"
+ },
+ {
+ "key": "destIpDistribution",
+ "type": "piechart",
+ "title": "destIpDistribution",
+ "datasource": "destIpDistribution"
+ }
+ ]
+ },
+ {
+ "key": "retranList",
+ "type": "table",
+ "title": "重传详情列表",
+ "datasource": "retranList"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/ossre.json b/sysom_web/public/resource/diagnose/v2/ossre.json
new file mode 100644
index 00000000..d9021cf1
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/ossre.json
@@ -0,0 +1,115 @@
+{
+ "servicename": "ossre",
+ "version": 1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP"
+ }
+ ],
+ "variables": [],
+ "pannels": [
+ {
+ "key": "pieRow",
+ "type": "row",
+ "title": "总体检查情况",
+ "datasource": "",
+ "children": [
+ {
+ "key": "hostInfo",
+ "type": "markdown",
+ "title": "系统信息",
+ "datasource": "hostInfo"
+ },
+ {
+ "key": "checkItems",
+ "type": "piechart",
+ "title": "检查项",
+ "datasource": "checkItems"
+ }
+ ]
+ },
+ {
+ "key": "ossre_result",
+ "type": "table",
+ "title": "",
+ "datasource": "OssreResult",
+ "columns": [
+ {
+ "key": "inspect_items",
+ "title": "pages.diagnose.ossre.ossre_result.inspect_items",
+ "valueType": "text",
+ "width": 150
+ },
+ {
+ "key": "status",
+ "title": "pages.diagnose.ossre.ossre_result.status",
+ "valueEnum": {
+ "normal": {
+ "text": "正常",
+ "status": "Success"
+ },
+ "warning": {
+ "text": "告警",
+ "status": "Warning"
+ },
+ "error": {
+ "text": "异常",
+ "status": "Error"
+ },
+ "critical": {
+ "text": "严重异常",
+ "status": "Error"
+ }
+ },
+ "width": 100
+ },
+ {
+ "key": "abnormal_count",
+ "title": "pages.diagnose.ossre.ossre_result.abnormal_count",
+ "valueType": "digit",
+ "width": 100
+ },
+ {
+ "key": "inspect_result",
+ "title": "pages.diagnose.ossre.ossre_result.inspect_result",
+ "valueType": "text"
+ },
+ {
+ "key": "options",
+ "title": "pages.diagnose.ossre.ossre_result.options",
+ "valueType": "text",
+ "width": 200
+ }
+ ],
+ "fieldConfig": {
+ "mappings": [
+ {
+ "type": "value",
+ "options": {
+ "critical": {
+ "color": "#FF000066",
+ "text": "严重异常"
+ },
+ "error": {
+ "color": "#FF663366",
+ "text": "异常"
+ },
+ "warning": {
+ "color": "#FF990066",
+ "text": "告警"
+ },
+ "normal": {
+ "color": "#00990066",
+ "text": "正常"
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sysom_web/public/resource/diagnose/v2/rca/.gitkeep b/sysom_web/public/resource/diagnose/v2/rca/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/sysom_web/public/resource/diagnose/v2/storage/iodiagnose.json b/sysom_web/public/resource/diagnose/v2/storage/iodiagnose.json
new file mode 100644
index 00000000..3c43d716
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/storage/iodiagnose.json
@@ -0,0 +1,28 @@
+{
+ "servicename": "iodiagnose",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP,我们将在会这台机器内部发起IO诊断"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "30",
+ "label": "诊断时长",
+ "tooltips": "诊断时长,也是IO诊断统计周期,单位秒,不建议低于20秒"
+ }
+ ],
+ "pannels": [
+ {
+ "key": "overview",
+ "type": "table",
+ "title": "diagnose result",
+ "datasource": "overview"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/storage/iofsstat.json b/sysom_web/public/resource/diagnose/v2/storage/iofsstat.json
new file mode 100644
index 00000000..f63b8000
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/storage/iofsstat.json
@@ -0,0 +1,60 @@
+{
+ "servicename": "iofsstat",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP,我们将在会这台机器内部发起IO流量统计"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "15",
+ "label": "诊断时长",
+ "tooltips": "诊断时长,也是IO流量统计周期,单位秒,建议不超过60秒"
+ },
+ {
+ "type": "text",
+ "name": "disk",
+ "initialValue": "",
+ "label": "目标磁盘",
+ "tooltips": "请输入你要诊断的磁盘,如vda,sda等等,缺省为所有磁盘"
+ }
+ ],
+ "variables": [
+ {
+ "key": "disks",
+ "label": "磁盘",
+ "datasource": "disks"
+ }
+ ],
+ "pannels": [
+ {
+ "key": "overview",
+ "type": "table",
+ "title": "diagnose result",
+ "datasource": "overview"
+ },
+ {
+ "key": "diskIOstat",
+ "type": "table",
+ "title": "Disk IO traffic analysis",
+ "datasource": "diskIOstat_${disks}"
+ },
+ {
+ "key": "taskIOstat",
+ "type": "table",
+ "title": "Process IO traffic analysis",
+ "datasource": "taskIOstat_${disks}"
+ },
+ {
+ "key": "taskIOblocksize",
+ "type": "table",
+ "title": "Process IO Block Size Distribution",
+ "datasource": "taskIOblocksize_${disks}"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/storage/iohang.json b/sysom_web/public/resource/diagnose/v2/storage/iohang.json
new file mode 100644
index 00000000..cafec68a
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/storage/iohang.json
@@ -0,0 +1,71 @@
+{
+ "servicename": "iohang",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP,我们将在会这台机器内部发起IO HANG诊断"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "10",
+ "label": "诊断时长",
+ "tooltips": "请输入你要诊断的时长,单位秒"
+ },
+ {
+ "type": "text",
+ "name": "threshold",
+ "initialValue": "5000",
+ "label": "时间阈值",
+ "tooltips": "保留IO HANG住时间超过阈值的IO,单位毫秒"
+ },
+ {
+ "type": "text",
+ "name": "disk",
+ "initialValue": "",
+ "label": "目标磁盘",
+ "tooltips": "请输入你要诊断的磁盘,如vda,sda等等,缺省为所有磁盘"
+ }
+ ],
+ "variables": [
+ {
+ "key": "disks",
+ "label": "磁盘",
+ "datasource": "disks"
+ }
+ ],
+ "pannels": [
+ {
+ "key": "iohangOverview",
+ "type": "stat",
+ "title": "IO HANG overview",
+ "datasource": "iohangOverview_${disks}",
+ "fieldConfig": {
+ "mappings": [{
+ "type": "value",
+ "options": {
+ "normal": { "color": "green" },
+ "abnormal": { "color": "red" }
+ }
+ }],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ { "color": "red", "value": 1 },
+ { "color": "green", "value": 0 }
+ ]
+ }
+ }
+ },
+ {
+ "key": "singleIO",
+ "type": "table",
+ "title": "More details of TOP 10 IO",
+ "datasource": "singleIO_${disks}"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/storage/iolatency.json b/sysom_web/public/resource/diagnose/v2/storage/iolatency.json
new file mode 100644
index 00000000..2e578b57
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/storage/iolatency.json
@@ -0,0 +1,120 @@
+{
+ "servicename": "iolatency",
+ "version":1.0,
+ "taskform": [
+ {
+ "type": "select_host",
+ "name": "instance",
+ "initialValue": "",
+ "label": "实例IP",
+ "tooltips": "请输入你要诊断的IP,我们将在会这台机器内部发起IO时延诊断"
+ },
+ {
+ "type": "text",
+ "name": "timeout",
+ "initialValue": "10",
+ "label": "诊断时长",
+ "tooltips": "请输入你要诊断的时长,单位秒"
+ },
+ {
+ "type": "text",
+ "name": "threshold",
+ "initialValue": "1000",
+ "label": "时间阈值",
+ "tooltips": "保留IO延迟大于设定时间阈值的IO(时间单位:ms)"
+ },
+ {
+ "type": "text",
+ "name": "disk",
+ "initialValue": "",
+ "label": "目标磁盘",
+ "tooltips": "请输入你要诊断的磁盘,如vda,sda等等,缺省为所有磁盘"
+ }
+ ],
+ "variables": [
+ {
+ "key": "disks",
+ "label": "磁盘",
+ "datasource": "disks"
+ }
+ ],
+ "pannels": [
+ {
+ "key": "iolatencyOverview",
+ "type": "stat",
+ "title": "Iolatency overview",
+ "datasource": "iolatencyOverview_${disks}",
+ "fieldConfig": {
+ "mappings": [{
+ "type": "value",
+ "options": {
+ "normal": { "color": "green" },
+ "abnormal": { "color": "red" }
+ }
+ }],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ { "color": "red", "value": 0 },
+ { "color": "green", "value": -1 }
+ ]
+ }
+ }
+ },
+ {
+ "key": "iolatencyDistribution",
+ "type": "flow",
+ "title": "Overall delay distribution",
+ "flowconfigs": {
+ "layout":{
+ "type": "linear"
+ },
+ "nodes": [
+ {
+ "id": "os(block)",
+ "tips": "The time delay of the general block layer in OS kernel(unit: us)"
+ },
+ {
+ "id": "os(driver)",
+ "tips":"The time delay of OS kernel driver(unit: us)"
+ },
+ {
+ "id": "disk",
+ "tips": "The time delay of disk(unit: us)"
+ },
+ {
+ "id": "os(complete)",
+ "tips": "The time delay of io complete in OS kernel(unit: us)"
+ }
+ ],
+ "edges": [
+ {
+ "source": "os(block)",
+ "target": "os(driver)"
+ },
+ {
+ "source": "os(driver)",
+ "target": "disk"
+ },
+ {
+ "source": "disk",
+ "target": "os(complete)"
+ }
+ ]
+ },
+ "datasource": "iolatencyDistribution_${disks}"
+ },
+ {
+ "key": "singleIOMetrics",
+ "type": "timeseries",
+ "title": "Single IO delay metrics display",
+ "datasource": "singleIOMetrics_${disks}"
+ },
+ {
+ "key": "singleIO",
+ "type": "table",
+ "title": "More details of TOP 10 IO",
+ "datasource": "singleIO_${disks}"
+ }
+ ]
+}
diff --git a/sysom_web/public/resource/diagnose/v2/storage/readme b/sysom_web/public/resource/diagnose/v2/storage/readme
new file mode 100644
index 00000000..e2b3bc2b
--- /dev/null
+++ b/sysom_web/public/resource/diagnose/v2/storage/readme
@@ -0,0 +1 @@
+请在此文件夹添加IO相关的面板配置文件。
diff --git a/sysom_web/src/pages/diagnose/components/TablePannel.jsx b/sysom_web/src/pages/diagnose/components/TablePannel.jsx
index 8f6e1f5f..1deaacfe 100644
--- a/sysom_web/src/pages/diagnose/components/TablePannel.jsx
+++ b/sysom_web/src/pages/diagnose/components/TablePannel.jsx
@@ -4,14 +4,20 @@ import fieldModifier from "./fieldModifier"
import { Empty } from 'antd';
import { Typography } from 'antd';
const { Text } = Typography;
+import { useIntl } from 'umi';
const TablePannel = (props) => {
const configs = props.configs
const data = props.data
+ const intl = useIntl();
//table background color render
- const bgColorRender = (text, record) => {
+ const bgColorRender = (elem, record) => {
+ let text = elem;
+ if (typeof elem !== "string") {
+ text = elem.props.text;
+ }
const [value, color] = fieldModifier(configs.fieldConfig, text, record, data)
return {
@@ -22,34 +28,53 @@ const TablePannel = (props) => {
wordBreak: 'break-word'
}
},
- children: {value}
+ children: {
+ (typeof elem === "string") ?
+ value :
+ elem
+ }
}
}
let columns = [];
- if (!!data && data.length > 0) {
- let enableSortColumn = configs.tableConfig?.enableSortColumn;
-
- columns = data && Object.keys(data[0]).map((key) => {
- let res = {
- title: key,
- dataIndex: key,
- render: bgColorRender
+ if (!!configs.columns) {
+ columns = configs.columns;
+ for (let i = 0; i < columns.length; i++) {
+ let column = columns[i];
+ if (!column.dataIndex) {
+ column.dataIndex = column.key;
+ }
+ if (column.title.startsWith("pages.diagnose")) {
+ column.title = intl.formatMessage({ id: column.title })
}
+ // column.render = bgColorRender;
+ column.render = bgColorRender;
+ }
+ } else {
+ if (!!data && data.length > 0) {
+ let enableSortColumn = configs.tableConfig?.enableSortColumn;
- if (!!enableSortColumn) {
- if (enableSortColumn.includes(key)) {
- res.sorter = (a, b) => a[key] - b[key]
+ columns = data && Object.keys(data[0]).map((key) => {
+ let res = {
+ title: key,
+ dataIndex: key,
+ render: bgColorRender
}
- }
- return res;
- });
- }
+ if (!!enableSortColumn) {
+ if (enableSortColumn.includes(key)) {
+ res.sorter = (a, b) => a[key] - b[key]
+ }
+ }
- //filter reserve keyword
- const keyword = ["key", "children"]
- columns = columns?.filter((col) => !keyword.includes(col.title))
+ return res;
+ });
+ //filter reserve keyword
+ const keyword = ["key", "children"]
+ columns = columns?.filter((col) => !keyword.includes(col.title))
+ }
+ }
+ // console.log(columns);
return (
{
for (let i = 0; i < menus.length; i++) {
let menu = menus[i];
if (menu.endsWith(service_name)) {
- pannelJsonUrl = `/resource/diagnose/v1${(menu.split("menu.diagnose")[1].split(".")).join("/")}.json`
+ pannelJsonUrl = `/resource/diagnose/v2${(menu.split("menu.diagnose")[1].split(".")).join("/")}.json`
break
}
}
diff --git a/sysom_web/src/pages/diagnose/diagnose.jsx b/sysom_web/src/pages/diagnose/diagnose.jsx
index cae0a18b..d1d4f551 100644
--- a/sysom_web/src/pages/diagnose/diagnose.jsx
+++ b/sysom_web/src/pages/diagnose/diagnose.jsx
@@ -49,7 +49,7 @@ const Diagnose = (props) => {
const intl = useIntl();
useEffect(() => {
- request("/resource/diagnose/v1/multichannel.json")
+ request("/resource/diagnose/v2/multichannel.json")
.catch(err => {
return Promise.resolve({
"version": 1.0,
@@ -71,7 +71,7 @@ const Diagnose = (props) => {
// Get config
let urlslice = props.match.url.split("/")
- urlslice.splice(2, 0, "v1")
+ urlslice.splice(2, 0, "v2")
return request(`/resource${urlslice.join("/")}.json`)
})
.then((res) => {
--
Gitee
From cd89382f7533d956dd6fbd99788198898f8bbf9a Mon Sep 17 00:00:00 2001
From: wb-msm261421
Date: Fri, 22 Dec 2023 16:27:17 +0800
Subject: [PATCH 035/176] test(log monitor): sysom log test or sysom moitor
test
---
sysom_web/cypress/e2e/log/audit_log.cy.js | 16 +
sysom_web/cypress/e2e/log/node_log.cy.js | 11 +
sysom_web/cypress/e2e/log/task_log.cy.js | 14 +
.../cypress/e2e/monitor/cluster_monitor.cy.js | 104 +++
sysom_web/cypress/e2e/monitor/dashboard.cy.js | 690 ++++++++++++++++++
sysom_web/cypress/support/commands.js | 91 ++-
6 files changed, 925 insertions(+), 1 deletion(-)
create mode 100644 sysom_web/cypress/e2e/log/audit_log.cy.js
create mode 100644 sysom_web/cypress/e2e/log/node_log.cy.js
create mode 100644 sysom_web/cypress/e2e/log/task_log.cy.js
create mode 100644 sysom_web/cypress/e2e/monitor/cluster_monitor.cy.js
create mode 100644 sysom_web/cypress/e2e/monitor/dashboard.cy.js
diff --git a/sysom_web/cypress/e2e/log/audit_log.cy.js b/sysom_web/cypress/e2e/log/audit_log.cy.js
new file mode 100644
index 00000000..84e6002e
--- /dev/null
+++ b/sysom_web/cypress/e2e/log/audit_log.cy.js
@@ -0,0 +1,16 @@
+///
+
+
+describe("SysOM Log Manager Test", () => {
+ beforeEach(() => {
+ cy.login()
+ })
+ it.only("select audit log and filter audit log", () => {
+ cy.sysomLogSelectOrFilter("journal/audit", {
+ ip: '127.0.0.1',
+ path: '/api/v1/host/',
+ methond: 'GET',
+ request_type: 'operate'
+ }, true)
+ })
+})
\ No newline at end of file
diff --git a/sysom_web/cypress/e2e/log/node_log.cy.js b/sysom_web/cypress/e2e/log/node_log.cy.js
new file mode 100644
index 00000000..094814f2
--- /dev/null
+++ b/sysom_web/cypress/e2e/log/node_log.cy.js
@@ -0,0 +1,11 @@
+///
+
+
+describe("SysOM Log Manager Test", () => {
+ beforeEach(() => {
+ cy.login()
+ })
+ it.only("select node log and filter node log", () => {
+ cy.sysomLogSelectOrFilter("journal/node", { instance: '192.168.0.137' }, false)
+ })
+})
\ No newline at end of file
diff --git a/sysom_web/cypress/e2e/log/task_log.cy.js b/sysom_web/cypress/e2e/log/task_log.cy.js
new file mode 100644
index 00000000..606a2e73
--- /dev/null
+++ b/sysom_web/cypress/e2e/log/task_log.cy.js
@@ -0,0 +1,14 @@
+///
+
+
+describe("SysOM Log Manager Test", () => {
+ beforeEach(() => {
+ cy.login()
+ })
+ it.only("select task log and filter task log", () => {
+ cy.sysomLogSelectOrFilter("journal/task", {
+ task_id: 'YqS7Lr9P',
+ },
+ false)
+ })
+})
\ No newline at end of file
diff --git a/sysom_web/cypress/e2e/monitor/cluster_monitor.cy.js b/sysom_web/cypress/e2e/monitor/cluster_monitor.cy.js
new file mode 100644
index 00000000..82673b0c
--- /dev/null
+++ b/sysom_web/cypress/e2e/monitor/cluster_monitor.cy.js
@@ -0,0 +1,104 @@
+///
+
+describe("SysOM Cluster Monitor Dashboard Test", () => {
+ beforeEach(() => {
+ cy.login();
+ })
+
+ it("Cluster monitor test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/cluster_monitor");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000);
+
+ cy.getPannelContentByTitle("集群总CPU核数/节点数").contains("cores");
+ cy.getPannelContentByTitle("集群总CPU核数/节点数").contains("nodes");
+
+ cy.getPannelContentByTitle("集群CPU利用率分布").find("ul li").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("集群内存使用分布").find("ul li").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("集群内存总量").contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.least(0);
+ })
+
+ cy.getPannelContentByTitle("集群网络健康度").contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.least(0);
+ })
+
+ cy.getPannelContentByTitle("集群内存健康度").contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.least(0);
+ })
+ cy.getPannelContentByTitle("集群CPU健康度").contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.least(0);
+ })
+
+ cy.getPannelContentByTitle("集群存储健康度").contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.least(0);
+ })
+
+ cy.getPannelContentByTitle("节点内存延时诊断").then(($el) => {
+ if ($el.text().includes("No data")) {
+ cy.wrap($el).contains("No data");
+ } else {
+
+ }
+ })
+
+ cy.getPannelContentByTitle("容器内存延时诊断").then(($el) => {
+ if ($el.text().includes("No data")) {
+ cy.wrap($el).contains("No data");
+ } else {
+
+ }
+ })
+
+ cy.getPannelContentByTitle("节点内存使用率诊断").find("tbody tr").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("节点CPU利用率诊断").find("tbody tr").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("节点CPU延时诊断").find("tbody tr").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("集群平均 CPU利用率").find("tbody tr").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("集群平均内存使用率").find("ul li").should("have.length.gte", 1); // Legend 至少有一列
+
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").should("have.length.gte", 1);
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").eq(0).find("td").eq(0).contains("user");
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").eq(1).find("td").eq(0).contains("nice");
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").eq(2).find("td").eq(0).contains("sys");
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").eq(3).find("td").eq(0).contains("softirq");
+ cy.getPannelContentByTitle("集群平均CPU利用率分布情况").find("tbody tr").eq(4).find("td").eq(0).contains("iowait");
+
+ cy.getPannelContentByTitle("总内存使用情况").find("tbody tr").should("have.length.gte", 1);
+ cy.getPannelContentByTitle("总内存使用情况").find("tbody tr").eq(0).find("td").eq(0).contains("free");
+ cy.getPannelContentByTitle("总内存使用情况").find("tbody tr").eq(1).find("td").eq(0).contains("used");
+ cy.getPannelContentByTitle("总内存使用情况").find("tbody tr").eq(2).find("td").eq(0).contains("cache+buffer");
+ cy.getPannelContentByTitle("总内存使用情况").find("tbody tr").eq(3).find("td").eq(0).contains("total");
+
+ cy.getPannelContentByTitle("集群平均调度延迟").find("tbody tr").should("have.length.gte", 1);
+ cy.getPannelContentByTitle("集群平均调度延迟").find("tbody tr").eq(0).find("td").eq(0).contains("调度延迟");
+
+ cy.getPannelContentByTitle("集群用户态内存使用情况").find("ul li").should("have.length.gte", 1);
+
+ cy.getPannelContentByTitle("集群节点平均load1").find("tbody tr").should("have.length.gte", 1);
+
+ cy.getPannelContentByTitle("集群内核态内存使用情况").find("ul li").should("have.length.gte", 1);
+
+ cy.getPannelContentByTitle("集群节点任务统计信息").find("tbody tr").should("have.length.gte", 1);
+ cy.getPannelContentByTitle("集群节点任务统计信息").find("tbody tr").eq(0).find("td").eq(0).contains("nr_forks");
+ cy.getPannelContentByTitle("集群节点任务统计信息").find("tbody tr").eq(1).find("td").eq(0).contains("nr_blocked");
+
+ cy.getPannelContentByTitle("集群app与kernel内存对比").find("ul li").should("have.length.gte", 1);
+
+ cy.getPannelContentByTitle("容器大盘").contains("容器大盘详情");
+
+ cy.getPannelContentByTitle("节点大盘").contains("节点大盘详情");
+ })
+})
\ No newline at end of file
diff --git a/sysom_web/cypress/e2e/monitor/dashboard.cy.js b/sysom_web/cypress/e2e/monitor/dashboard.cy.js
new file mode 100644
index 00000000..4500c60d
--- /dev/null
+++ b/sysom_web/cypress/e2e/monitor/dashboard.cy.js
@@ -0,0 +1,690 @@
+/*
+ * @Author: wb-msm241621
+ * @Date: 2023-12-20 17:15:53
+ * @LastEditTime: 2023-12-22 15:54:55
+ * @Description:
+ */
+///
+
+
+describe("SysOM dashboard Monitor Dashboard Test", () => {
+ beforeEach(() => {
+ cy.login();
+ })
+
+ it("Dashboard monitor test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ /* Quick CPU / Mem / Disk */
+ // 当前面板 CPU Busy
+ cy.panelNumericalValueGteTest("CPU Busy")
+
+ // 当前面板Sys Load (5m avg)
+ cy.panelNumericalValueGteTest("Sys Load (5m avg)")
+
+ // 当前面板Sys Load (15m avg)
+ cy.panelNumericalValueGteTest("Sys Load (15m avg)")
+
+ // 当前面板RAM Used
+ cy.panelNumericalValueGteTest("RAM Used")
+
+ // 当前面板SWAP Used
+ cy.panelNumericalValueGteTest("SWAP Used")
+
+ // 当前面板Root FS Used
+ cy.panelNumericalValueGteTest("Root FS Used")
+
+ // 当前面板 CPU Cores
+ cy.panelNumericalValueGteTest("CPU Cores")
+
+ // 当前面板 Uptime
+ cy.panelNumericalValueGteTest("Uptime")
+
+ // 当前面板 RootFS Total
+ cy.panelNumericalValueGteTest("RootFS Total")
+
+ // 当前面板 RAM Total
+ cy.panelNumericalValueGteTest("RAM Total")
+
+ // 当前面板 SWAP Total
+ cy.panelNumericalValueGteTest("SWAP Total")
+ })
+
+ it("Basic CPU / Mem / Net / Disk Test", () => {
+ /*
+ * Basic CPU / Mem / Net / Disk
+ */
+
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 当前面板 CPU Basic
+ cy.panelAtagValueGteTest("CPU Basic")
+
+ // 当前面板Memory Basic
+ cy.panelAtagValueGteTest("Memory Basic")
+
+ // 当前面板 Network Traffic Basic
+ cy.panelAtagValueGteTest("Network Traffic Basic")
+
+ // 当前面板 Disk Space Used Basic
+ cy.panelAtagValueGteTest("Disk Space Used Basic")
+ })
+
+ it("CPU / Memory / Net / Disk Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开CPU / Memory / Net / Disk 标签
+ cy.openMainLabel("CPU / Memory / Net / Disk")
+
+ // 当前面板 CPU
+ const cpuPropertys = [
+ // 'System - Processes executing in kernel mode',
+ // 'User - Normal processes executing in user mode',
+ // 'Nice - Niced processes executing in user mode',
+ // 'Idle - Waiting for something to happen',
+ // 'Iowait - Waiting for I/O to complete',
+ // 'Irq - Servicing interrupts',
+ // 'Softirq - Servicing softirqs',
+ // 'Steal - Time spent in other operating systems when running in a virtualized environment'
+ ]
+ cy.panelFoldLineTableGteTest('CPU')
+
+ // 当前面板 Memory Stack
+ // const memoryStackPropertys = [
+ // 'Apps - Memory used by user-space applications',
+ // 'PageTables - Memory used to map between virtual and physical memory addresses',
+ // 'SwapCache - Memory that keeps track of pages that have been fetched from swap but not yet been modified',
+ // 'Slab - Memory used by the kernel to cache data structures for its own use (caches like inode, dentry, etc)',
+ // 'Cache - Parked file data (file content) cache',
+ // 'Buffers - Block device (e.g. harddisk) cache',
+ // 'Unused - Free memory unassigned',
+ // 'Swap - Swap space used',
+ // 'Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working',
+ // ]
+ const memoryStackPropertys = []
+ cy.panelFoldLineTableGteTest('Memory Stack', memoryStackPropertys)
+
+ // 当前面板 Network Traffic
+ const networkTrafficPropertys = [
+ // 'eth0 - Receive',
+ // 'lo - Receive',
+ // 'eth0 - Transmit',
+ // 'lo - Transmit',
+ ]
+ cy.panelFoldLineTableGteTest('Network Traffic', networkTrafficPropertys)
+
+ // 当前面板 Disk Space Used
+ const diskSpaceUsedPropertys = [
+ // '/run/user/0',
+ // '/run',
+ // '/usr/local/sysom/server/builder/hotfix',
+ // '/',
+ ]
+ cy.panelFoldLineTableGteTest('Disk Space Used', diskSpaceUsedPropertys)
+
+ // 当前面板 Disk IOps
+ const diskIopsPropertys = [
+ // 'vda - Writes completed'
+ ]
+ cy.panelFoldLineTableGteTest('Disk IOps', diskIopsPropertys)
+
+ // 当前面板 I/O Usage Read / Write
+ const ioUsageReadWritePropertys = [
+ // 'vda - Successfully read bytes',
+ // 'vda - Successfully written bytes'
+ ]
+ cy.panelFoldLineTableGteTest('I/O Usage Read / Write', ioUsageReadWritePropertys)
+
+ // 当前面板 I/O Utilization
+ const ioUtilizationPropertys = [
+ // 'vda'
+ ]
+ cy.panelFoldLineTableGteTest('I/O Utilization', ioUtilizationPropertys)
+
+
+ })
+
+ it("Memory Meminfo Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Memory Meminfo 标签
+ cy.openMainLabel("Memory Meminfo")
+
+ // 当前面板 Memory Active / Inactive
+ const memoryActivePropertys = [
+ // 'Inactive - Memory which has been less recently used. It is more eligible to be reclaimed for other purposes',
+ // 'Active - Memory that has been used more recently and usually not reclaimed unless absolutely necessary'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Active / Inactive', memoryActivePropertys)
+
+ // 当前面板 Memory Commited
+ const memoryCommitedPropertys = [
+ // 'Committed_AS - Amount of memory presently allocated on the system',
+ // 'CommitLimit - Amount of memory currently available to be allocated on the system'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Commited', memoryCommitedPropertys)
+
+ // 当前面板 Memory Active / Inactive Detail
+ const memoryActiveDetailPropertys = [
+ // 'Inactive_file - File-backed memory on inactive LRU list',
+ // 'Inactive_anon - Anonymous and swap cache on inactive LRU list, including tmpfs (shmem)',
+ // 'Active_file - File-backed memory on active LRU list',
+ // 'Active_anon - Anonymous and swap cache on active least-recently-used (LRU) list, including tmpfs'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Active / Inactive Detail', memoryActiveDetailPropertys)
+
+ // 当前面板 Memory Writeback and Dirty
+ const memoryWritebackAndDirtyPropertys = [
+ // 'Writeback - Memory which is actively being written back to disk',
+ // 'WritebackTmp - Memory used by FUSE for temporary writeback buffers',
+ // 'Dirty - Memory which is waiting to get written back to the disk'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Writeback and Dirty', memoryWritebackAndDirtyPropertys)
+
+ // 当前面板 Memory Shared and Mapped
+ const memorySharedAndMappedPropertys = [
+ // 'Mapped - Used memory in mapped pages files which have been mmaped, such as libraries',
+ // 'Shmem - Used shared memory (shared between several processes, thus including RAM disks)',
+ // 'ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages',
+ // 'ShmemPmdMapped - Ammount of shared (shmem/tmpfs) memory backed by huge pages'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Shared and Mapped', memorySharedAndMappedPropertys)
+
+ // 当前面板 Memory Slab
+ const memorySlabPropertys = [
+ // 'SUnreclaim - Part of Slab, that cannot be reclaimed on memory pressure',
+ // 'SReclaimable - Part of Slab, that might be reclaimed, such as caches'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Slab', memorySlabPropertys)
+
+ // 当前面板 Memory Vmalloc
+ const memoryVmallocPropertys = [
+ // "VmallocChunk - Largest contigious block of vmalloc area which is free",
+ // "VmallocTotal - Total size of vmalloc memory area",
+ // "VmallocUsed - Amount of vmalloc area which is used"
+ ]
+ cy.panelFoldLineTableGteTest('Memory Vmalloc', memoryVmallocPropertys)
+
+ // 当前面板 Memory Bounce
+ const memoryBouncePropertys = [
+ // 'Bounce - Memory used for block device bounce buffers'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Bounce', memoryBouncePropertys)
+
+ // 当前面板 Memory Anonymous
+ const memoryAnonymousPropertys = [
+ // 'AnonHugePages - Memory in anonymous huge pages',
+ // 'AnonPages - Memory in user pages not backed by files'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Anonymous', memoryAnonymousPropertys)
+
+ // 当前面板 Memory Kernel / CPU
+ const memoryKernelCPUPropertys = [
+ // 'KernelStack - Kernel memory stack. This is not reclaimable',
+ // 'PerCPU - Per CPU memory allocated dynamically by loadable modules'
+ ]
+ cy.panelFoldLineTableGteTest('Memory Kernel / CPU', memoryKernelCPUPropertys)
+
+ // 当前面板 Memory HugePages Counter
+ const MemoryHugePagesCounterpropertys = [
+ // 'HugePages_Free - Huge pages in the pool that are not yet allocated',
+ // 'HugePages_Rsvd - Huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made',
+ // 'HugePages_Surp - Huge pages in the pool above the value in /proc/sys/vm/nr_hugepages'
+ ]
+ cy.panelFoldLineTableGteTest('Memory HugePages Counter', MemoryHugePagesCounterpropertys)
+
+ // 当前面板 Memory HugePages Size
+ const MemoryHugePagesSizePropertys = [
+ // 'HugePages - Total size of the pool of huge pages',
+ // 'Hugepagesize - Huge Page size'
+ ]
+ cy.panelFoldLineTableGteTest('Memory HugePages Size', MemoryHugePagesSizePropertys)
+
+ // 当前面板 Memory DirectMap
+ const MemoryDirectMapPropertys = [
+ // 'DirectMap1G - Amount of pages mapped as this size',
+ // 'DirectMap2M - Amount of pages mapped as this size',
+ // 'DirectMap4K - Amount of pages mapped as this size'
+ ]
+ cy.panelFoldLineTableGteTest('Memory DirectMap', MemoryDirectMapPropertys)
+
+ // 当前面板 Memory Unevictable and MLocked
+ const MemoryUnevictableandMLockedPropertys = [
+ // "Unevictable - Amount of unevictable memory that can't be swapped out for a variety of reasons",
+ // "MLocked - Size of pages locked to memory using the mlock() system call"
+ ]
+ cy.panelFoldLineTableGteTest('Memory Unevictable and MLocked', MemoryUnevictableandMLockedPropertys)
+
+ // 当前面板 Memory NFS
+ const MemoryNFSPropertys = [
+ // "NFS Unstable - Memory in NFS pages sent to the server, but not yet commited to the storage"
+ ]
+ cy.panelFoldLineTableGteTest('Memory NFS')
+ })
+
+ it("Memory Vmstat Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Memory Vmstat 标签
+ cy.openMainLabel("Memory Vmstat")
+
+ // 当前面板 Memory Pages In / Out
+ cy.panelFoldLineTableGteTest('Memory Pages In / Out')
+
+ // 当前面板 Memory Pages Swap In / Out
+ cy.panelFoldLineTableGteTest('Memory Pages Swap In / Out')
+
+ // 当前面板 Memory Page Faults
+ cy.panelFoldLineTableGteTest('Memory Page Faults')
+
+ // 当前面板OOM Killer
+ cy.panelFoldLineTableGteTest('OOM Killer')
+ })
+
+ it("System Timesync Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 System Timesync 标签
+ cy.openMainLabel("System Timesync")
+
+ // 当前面板 Time Syncronized Drift
+ cy.panelFoldLineTableGteTest('Time Syncronized Drift')
+
+ // 当前面板 Time PLL Adjust
+ cy.panelFoldLineTableGteTest('Time PLL Adjust')
+
+ // 当前面板 Time Syncronized Status
+ cy.panelFoldLineTableGteTest('Time Syncronized Status')
+
+ // 当前面板 Time Misc
+ cy.panelFoldLineTableGteTest('Time Misc')
+ })
+
+ it("System Processes Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 标签
+ cy.openMainLabel("System Processes")
+
+ // 当前面板 Processes Status
+ cy.panelFoldLineTableGteTest('Processes Status')
+
+ // 当前面板 Processes State
+ cy.panelNoDataTest('Processes State')
+
+ // 当前面板 Processes Forks
+ cy.panelFoldLineTableGteTest('Processes Forks')
+
+ // 当前面板 Processes Memory
+ cy.panelFoldLineTableGteTest('Processes Memory')
+
+ // 当前面板 PIDs Number and Limit
+ cy.panelNoDataTest('PIDs Number and Limit')
+ // cy.getPannelContentByTitle("PIDs Number and Limit").find("tbody tr").should("have.length.gte", 1)
+
+ // 当前面板 Process schedule stats Running / Waiting
+ cy.panelFoldLineTableGteTest('Process schedule stats Running / Waiting')
+
+ // 当前面板 Threads Number and Limit
+ cy.panelNoDataTest('Threads Number and Limit')
+ })
+
+ it("System Misc Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 System Misc 标签
+ cy.openMainLabel("System Misc")
+
+ // 当前面板 Context Switches / Interrupts
+ cy.panelFoldLineTableGteTest("Context Switches / Interrupts")
+
+ // 当前面板 System Load
+ cy.panelFoldLineTableGteTest("System Load")
+
+ // 当前面板 Interrupts Detail
+ cy.panelNoDataTest("Interrupts Detail")
+
+ // 当前面板 Schedule timeslices executed by each cpu
+ cy.panelFoldLineTableGteTest("Schedule timeslices executed by each cpu")
+
+ // 当前面板 Entropy
+ cy.panelFoldLineTableGteTest("Entropy")
+
+ // 当前面板 CPU time spent in user and system contexts
+ cy.panelFoldLineTableGteTest("CPU time spent in user and system contexts")
+
+ // 当前面板 File Descriptors
+ cy.panelFoldLineTableGteTest("File Descriptors")
+ })
+
+ it("Hardware Misc Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Hardware Misc 标签
+ cy.openMainLabel("Hardware Misc")
+
+ // 当前面板 Hardware temperature monitor
+ cy.panelNoDataTest("Hardware temperature monitor")
+
+ // 当前面板 Throttle cooling device
+ cy.panelFoldLineTableGteTest("Throttle cooling device")
+
+ // 当前面板 Power supply
+ cy.panelNoDataTest("Power supply")
+ })
+
+ it("Systemd Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Systemd 标签
+ cy.openMainLabel("Systemd")
+
+ // 当前面板 Systemd Sockets
+ cy.panelNoDataTest("Systemd Sockets")
+
+ // 当前面板 Systemd Units State
+ cy.panelNoDataTest("Systemd Units State")
+ })
+
+ it("Storage Disk Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Storage Disk 标签
+ cy.openMainLabel("Storage Disk")
+
+ // 当前面板 Disk IOps Completed
+ cy.panelFoldLineTableGteTest("Disk IOps Completed")
+
+ // 当前面板 Disk R/W Data
+ cy.panelFoldLineTableGteTest("Disk R/W Data")
+
+ // 当前面板 Disk Average Wait Time
+ cy.panelFoldLineTableGteTest("Disk Average Wait Time")
+
+ // 当前面板 Average Queue Size
+ cy.panelFoldLineTableGteTest("Average Queue Size")
+
+ // 当前面板 Disk R/W Merged
+ cy.panelFoldLineTableGteTest("Disk R/W Merged")
+
+ // 当前面板 Time Spent Doing I/Os
+ cy.panelFoldLineTableGteTest("Time Spent Doing I/Os")
+
+ // 当前面板 Instantaneous Queue Size
+ cy.getPannelContentByTitle("Instantaneous Queue Size").find("canvas").should("have.length.gte", 1)
+ cy.getPannelContentByTitle("Instantaneous Queue Size").find("tbody").should("have.length.gte", 1)
+
+ // 当前面板 Disk IOps Discards completed / merged
+ cy.getPannelContentByTitle("Disk IOps Discards completed / merged").find("canvas").should("have.length.gte", 1)
+ cy.getPannelContentByTitle("Disk IOps Discards completed / merged").find("tbody").should("have.length.gte", 1)
+ })
+
+ it("Storage Filesystem Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Storage Filesystem 标签
+
+ cy.openMainLabel("Storage Filesystem")
+
+ // 当前面板 Filesystem space available
+ cy.panelFoldLineTableGteTest("Filesystem space available")
+
+ // 当前面板 File Nodes Free
+ cy.panelFoldLineTableGteTest("File Nodes Free")
+
+ // 当前面板 File Descriptor
+ cy.panelFoldLineTableGteTest("File Descriptor")
+
+ // 当前面板 File Nodes Size
+ cy.panelFoldLineTableGteTest("File Nodes Size")
+
+ // 当前面板 Filesystem in ReadOnly / Error
+ // cy.panelFoldLineTableGteTest("Filesystem in ReadOnly / Error")
+ cy.getPannelContentByTitle("Filesystem in ReadOnly / Error").find("canvas").should('be.empty')
+ cy.getPannelContentByTitle("Filesystem in ReadOnly / Error").find('tbody').should('be.empty')
+ })
+
+ it("Network Traffic Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Network Traffic 标签
+ cy.openMainLabel("Network Traffic")
+
+ // 当前面板 Network Traffic by Packets
+ cy.panelFoldLineTableGteTest("Network Traffic by Packets")
+
+ // 当前面板 Network Traffic Errors
+ cy.panelFoldLineTableGteTest("Network Traffic Errors")
+
+ // 当前面板 Network Traffic Drop
+ cy.panelFoldLineTableGteTest("Network Traffic Drop")
+
+ // 当前面板 Network Traffic Compressed
+ cy.panelFoldLineTableGteTest("Network Traffic Compressed")
+
+ // 当前面板 Network Traffic Multicast
+ cy.panelFoldLineTableGteTest("Network Traffic Multicast")
+
+ // 当前面板 Network Traffic Fifo
+ cy.panelFoldLineTableGteTest("Network Traffic Fifo")
+
+ // 当前面板 Network Traffic Frame
+ cy.panelFoldLineTableGteTest("Network Traffic Frame")
+
+ // 当前面板 Network Traffic Carrier
+ cy.panelFoldLineTableGteTest("Network Traffic Carrier")
+
+ // 当前面板 Network Traffic Colls
+ cy.panelFoldLineTableGteTest("Network Traffic Colls")
+
+ // 当前面板 NF Contrack
+ cy.panelNoDataTest("NF Contrack")
+ cy.wait(4000)
+
+ // 当前面板 ARP Entries
+ cy.panelFoldLineTableGteTest("ARP Entries")
+
+ // 当前面板 MTU
+ cy.panelFoldLineTableGteTest("MTU")
+
+ // 当前面板 Speed
+ cy.panelFoldLineTableGteTest("Speed")
+
+ // 当前面板 Queue Length
+ cy.panelFoldLineTableGteTest("Queue Length")
+
+ // 当前面板 Softnet Packets
+ cy.panelFoldLineTableGteTest("Softnet Packets")
+
+ // 当前面板 Softnet Out of Quota
+ cy.panelFoldLineTableGteTest("Softnet Out of Quota")
+
+ // 当前面板 Network Operational Status
+ cy.panelFoldLineTableGteTest("Network Operational Status")
+
+ })
+
+ it("Network Sockstat Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Network Sockstat 标签
+ cy.openMainLabel("Network Sockstat")
+
+ // 当前面板 Sockstat TCP
+ cy.panelFoldLineTableGteTest("Sockstat TCP")
+
+ // 当前面板 Sockstat UDP
+ cy.panelFoldLineTableGteTest("Sockstat UDP")
+
+ // 当前面板 Sockstat Used
+ cy.panelFoldLineTableGteTest("Sockstat Used")
+
+ // 当前面板 Sockstat Memory Size
+ cy.panelFoldLineTableGteTest("Sockstat Memory Size")
+
+ // 当前面板 Sockstat FRAG / RAW
+ cy.panelFoldLineTableGteTest("Sockstat FRAG / RAW")
+ })
+
+ it("Network Netstat Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Network Netstat 标签
+ cy.openMainLabel("Network Netstat")
+
+ // 当前面板 Netstat IP In / Out Octets
+ cy.panelFoldLineTableGteTest("Netstat IP In / Out Octets")
+
+ // 当前面板 Netstat IP Forwarding
+ cy.panelFoldLineTableGteTest("Netstat IP Forwarding")
+
+ // 当前面板 ICMP In / Out
+ cy.panelFoldLineTableGteTest("ICMP In / Out")
+
+ // 当前面板 ICMP Errors
+ cy.panelFoldLineTableGteTest("ICMP Errors")
+
+ // 当前面板 UDP In / Out
+ cy.panelFoldLineTableGteTest("UDP In / Out")
+
+ // 当前面板 UDP Errors
+ cy.panelFoldLineTableGteTest("UDP Errors")
+
+ // 当前面板 TCP In / Out
+ cy.panelFoldLineTableGteTest("TCP In / Out")
+
+ // 当前面板 TCP Errors
+ cy.panelFoldLineTableGteTest("TCP Errors")
+
+ // 当前面板 TCP Connections
+ cy.panelFoldLineTableGteTest("TCP Connections")
+
+ // 当前面板 TCP SynCookie
+ cy.panelFoldLineTableGteTest("TCP SynCookie")
+
+ // 当前面板 TCP Direct Transition
+ cy.panelFoldLineTableGteTest("TCP Direct Transition")
+ })
+
+ it("Node Exporter Test", () => {
+ // 1. 访问集群监控页面
+ cy.visit("/monitor/dashboard");
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 关闭Quick CPU / Mem / Disk标签
+ cy.openMainLabel("Quick CPU / Mem / Disk")
+
+ // 4. 打开 Node Exporter 标签
+ cy.openMainLabel("Node Exporter")
+
+ // 当前面板 Node Exporter Scrape Time
+ cy.panelFoldLineTableGteTest("Node Exporter Scrape Time")
+
+ // 当前面板 Node Exporter Scrape
+ cy.panelFoldLineTableGteTest("Node Exporter Scrape")
+ })
+})
diff --git a/sysom_web/cypress/support/commands.js b/sysom_web/cypress/support/commands.js
index 7f7984a1..adb704b0 100644
--- a/sysom_web/cypress/support/commands.js
+++ b/sysom_web/cypress/support/commands.js
@@ -160,4 +160,93 @@ Cypress.Commands.add("getPannelHeaderByTitle", (title) => {
Cypress.Commands.add("getPannelContentByTitle", (title) => {
return cy.getPannelByTitle(title).find("div.panel-content").scrollIntoView();
-});
\ No newline at end of file
+});
+
+/**
+ * SysOM 日志模块测试封装
+ * @param {*} pageUrl 页面地址
+ * @param {*} params 列表过滤参数
+ * @param {*} resultCallback 结果回调, 返回结果是否达到预期
+ */
+Cypress.Commands.add("sysomLogSelectOrFilter", (pageUrl, params, isSelect) => {
+ // 1. 跳转到自定义log页面
+ cy.visit(pageUrl)
+
+ // 2. 等待页面加载完成
+ cy.wait(2000)
+
+ // 3. 查找filter展开按钮并点击,若没有则跳过
+ if (isSelect) {
+ const el_show = 'a[class="ant-pro-form-collapse-button"]'
+ cy.get(el_show).contains("展开").click()
+ }
+
+ // 4. 输入查询参数
+ for (let param in params) {
+ cy.get(`input[id=${param}]`).focus().type(params[param], {force: true})
+ }
+
+ // 5. 点击查询按钮
+ cy.get(':nth-child(2) > .ant-btn > span').click()
+
+ // 6. table 内容断言
+ cy.get('.ant-table-tbody').find('tr').should("have.length.gte", 1)
+
+})
+
+/**
+ * 打开闭合的主标签
+ * @param {*} title panel tag
+ */
+Cypress.Commands.add("openMainLabel", (title) => {
+ cy.getIframeBody()
+ .find("div.react-grid-layout")
+ .find("div.react-grid-item")
+ .find("a")
+ .contains(title).click()
+})
+
+/*
+* 面板数值大于等于 0
+* @param {*} title panel tag
+*/
+Cypress.Commands.add("panelNumericalValueGteTest", (title) => {
+ cy.getPannelContentByTitle(title).contains(/\d+/).then(($el) => {
+ const num = parseInt($el.text());
+ expect(num).to.be.gte(0);
+ })
+})
+
+/**
+ * 面板取a便签数 大于等于 0
+ * @param {*} title panel tag
+ */
+
+Cypress.Commands.add("panelAtagValueGteTest", (title) => {
+ cy.getPannelContentByTitle(title).find("a").should("have.length.gte", 0)
+})
+
+/**
+ * 面板取折线统计图且具有Table
+ * @params {*} title panel tag
+ * @items {*} items 属性名称 列表
+ */
+Cypress.Commands.add("panelFoldLineTableGteTest", (title, Array) => {
+ cy.getPannelContentByTitle(title).find("tbody tr").should("have.length.gt", 0)
+ if (Array !== undefined) {
+ Array.forEach((item, index) => {
+ cy.getPannelContentByTitle(title).find("tbody tr").eq(index).find("td").eq(0).contains(item)
+ })
+ }
+})
+
+Cypress.Commands.add("panelNoDataTest", (title) => {
+ cy.getPannelContentByTitle(title).then(($el) => {
+ console.log($el.text())
+ if ($el.text().includes("No data")) {
+ cy.wrap($el).contains("No data");
+ } else {
+ cy.getPannelContentByTitle(title).find("canvas").should('be.empty')
+ }
+ })
+})
--
Gitee
From 3e3d173f4aa15b59215c3e1f619be03807861408 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Tue, 26 Dec 2023 14:07:27 +0800
Subject: [PATCH 036/176] feat(deploy): Support deploy by docker
---
README.md | 14 ++++-
docker/sysom-init.service | 4 +-
...sysom_dockerfile => sysom_base_dockerfile} | 16 ++++--
..._dockerfile => sysom_base_lite_dockerfile} | 37 +++++++++++---
docker/sysom_channel_dockerfile | 31 -----------
docker/sysom_diagnosis_dockerfile | 31 -----------
docker/sysom_hotfix_dockerfile | 31 -----------
docker/sysom_migration_dockerfile | 31 -----------
docker/sysom_monitor_server_dockerfile | 31 -----------
docker/sysom_vmcore_dockerfile | 31 -----------
docker/sysom_vul_dockerfile | 31 -----------
environment/0_env/requirements.txt | 1 +
.../1_sdk/sysom_utils/config_parser.py | 51 +++++++++++++++----
.../server/sysom_ad_proxy/sysom-ad_proxy.ini | 2 +-
script/server/sysom_alarm/sysom-alarm.ini | 2 +-
.../sysom_alert_pusher/sysom-alert_pusher.ini | 2 +-
.../sysom_cec_proxy/sysom-cec_proxy.ini | 2 +-
script/server/sysom_channel/sysom-channel.ini | 2 +-
.../sysom-cluster_health.ini | 2 +-
.../server/sysom_dingtalk/sysom-dingtalk.ini | 2 +-
script/server/sysom_hotfix/sysom-hotfix.ini | 2 +-
.../sysom_knowledge/sysom-knowledge.ini | 2 +-
script/server/sysom_log/sysom-log.ini | 2 +-
.../sysom-metric_anomaly_detection.ini | 2 +-
.../sysom_migration/sysom-migration.ini | 2 +-
.../sysom-monitor-server.ini | 2 +-
script/server/sysom_rca/sysom-rca.ini | 2 +-
script/server/sysom_vmcore/sysom-vmcore.ini | 2 +-
script/server/sysom_vul/sysom-vul.ini | 2 +-
script/sysom.sh | 6 +++
template/fastapi/scripts/template.ini | 2 +-
31 files changed, 123 insertions(+), 257 deletions(-)
rename docker/{sysom_dockerfile => sysom_base_dockerfile} (75%)
rename docker/{sysom_api_dockerfile => sysom_base_lite_dockerfile} (38%)
delete mode 100644 docker/sysom_channel_dockerfile
delete mode 100644 docker/sysom_diagnosis_dockerfile
delete mode 100644 docker/sysom_hotfix_dockerfile
delete mode 100644 docker/sysom_migration_dockerfile
delete mode 100644 docker/sysom_monitor_server_dockerfile
delete mode 100644 docker/sysom_vmcore_dockerfile
delete mode 100644 docker/sysom_vul_dockerfile
diff --git a/README.md b/README.md
index c38b05e9..23c6eeb9 100644
--- a/README.md
+++ b/README.md
@@ -224,7 +224,19 @@
Oct 10 12:58:51 mfeng bash[3217754]: + sed -i 's/^FIRST_INIT_DONE=0/FIRST_INIT_DONE=1/g' /usr/local/sysom/init_scripts/server/init.sh
```
-## 3. 通过 WEB 前端访问
+## 3. 容器化部署
+
+### 3.1 基础服务部署
+
+ ```bash
+ docker build -t sysom-base -f docker/sysom_base_dockerfile .
+ docker run -idt --privileged --name sysom-base sysom-base
+ ```
+
+ 可以通过修改 docker/sysom_base_dockerfile 使能不同的微服务
+
+
+## 4. 通过 WEB 前端访问
部署成功之后,可以通过访问部署时指定的公网/私网地址访问 SysOM前端,比如 http://172.22.3.238
diff --git a/docker/sysom-init.service b/docker/sysom-init.service
index 96c390f5..4abdbc4e 100644
--- a/docker/sysom-init.service
+++ b/docker/sysom-init.service
@@ -1,10 +1,12 @@
[Unit]
Description=Init sysom
After=mariadb.service
+Before=supervisord
[Service]
Type=oneshot
-ExecStart=bash -x /root/sysom/script/server/init.sh
+WorkingDirectory=/usr/local/sysom/init_scripts
+ExecStart=bash -x ./sysom.sh init ALL
[Install]
WantedBy=multi-user.target
\ No newline at end of file
diff --git a/docker/sysom_dockerfile b/docker/sysom_base_dockerfile
similarity index 75%
rename from docker/sysom_dockerfile
rename to docker/sysom_base_dockerfile
index be9d2a0f..937b595e 100644
--- a/docker/sysom_dockerfile
+++ b/docker/sysom_base_dockerfile
@@ -1,4 +1,14 @@
-FROM openanolis/anolisos:8.8
+
+FROM node:16.20.1 as web_builder
+COPY sysom_web /root/sysom_web
+WORKDIR /root/sysom_web
+RUN npm config set registry https://registry.npmmirror.com
+RUN yarn config set registry https://registry.npmmirror.com
+RUN yarn
+RUN yarn build
+
+
+FROM openanolis/anolisos:8.8 as prod
# Add epel
RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
@@ -28,11 +38,11 @@ COPY deps /root/sysom/deps
COPY environment /root/sysom/environment
COPY sysom_server /root/sysom/sysom_server
-COPY sysom_web/dist /usr/local/sysom/web
+COPY --from=web_builder /root/sysom_web/dist /usr/local/sysom/web
RUN bash -x /root/sysom/script/sysom.sh install deps ALL
RUN bash -x /root/sysom/script/sysom.sh install env ALL
-RUN bash -x /root/sysom/script/sysom.sh install ms sysom_api,sysom_diagnosis,sysom_channel,sysom_monitor_server,sysom_migration
+RUN bash -x /root/sysom/script/sysom.sh install ms sysom_api,sysom_diagnosis,sysom_channel,sysom_monitor_server,sysom_log,sysom_alarm
RUN yum clean all
diff --git a/docker/sysom_api_dockerfile b/docker/sysom_base_lite_dockerfile
similarity index 38%
rename from docker/sysom_api_dockerfile
rename to docker/sysom_base_lite_dockerfile
index 4eaa0b9c..4213bf6f 100644
--- a/docker/sysom_api_dockerfile
+++ b/docker/sysom_base_lite_dockerfile
@@ -1,4 +1,14 @@
-FROM openanolis/anolisos:8.8
+
+FROM node:16.20.1 as web_builder
+COPY sysom_web /root/sysom_web
+WORKDIR /root/sysom_web
+RUN npm config set registry https://registry.npmmirror.com
+RUN yarn config set registry https://registry.npmmirror.com
+RUN yarn
+RUN yarn build
+
+
+FROM openanolis/anolisos:8.8 as prod
# Add epel
RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
@@ -9,23 +19,34 @@ RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
RUN yum makecache
RUN yum install -y supervisor cronie net-tools
RUN systemctl enable crond
-# RUN systemctl enable supervisord
+RUN yum install -y python3
+RUN yum install -y nginx
+RUN yum install -y wget
+RUN systemctl enable supervisord
+RUN systemctl enable nginx
# Init sysom-diagnosis
ARG SYSOM_HOME=/usr/local/sysom
ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
RUN mkdir /root/sysom
+RUN mkdir -p /usr/local/sysom
COPY conf /root/sysom/conf
COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
+COPY deps /root/sysom/deps
+COPY environment /root/sysom/environment
+COPY sysom_server /root/sysom/sysom_server
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_api
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
+COPY --from=web_builder /root/sysom_web/dist /usr/local/sysom/web
+
+RUN bash -x /root/sysom/script/sysom.sh install deps nginx
+RUN bash -x /root/sysom/script/sysom.sh install env ALL
+RUN bash -x /root/sysom/script/sysom.sh install ms sysom_api,sysom_diagnosis,sysom_channel,sysom_monitor_server,sysom_log,
RUN yum clean all
+COPY docker/sysom-init.service /usr/lib/systemd/system/sysom-init.service
+RUN systemctl enable sysom-init.service
+
# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
+ENTRYPOINT [ "/usr/sbin/init" ]
\ No newline at end of file
diff --git a/docker/sysom_channel_dockerfile b/docker/sysom_channel_dockerfile
deleted file mode 100644
index 70e34b9f..00000000
--- a/docker/sysom_channel_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_channel
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_diagnosis_dockerfile b/docker/sysom_diagnosis_dockerfile
deleted file mode 100644
index 51972064..00000000
--- a/docker/sysom_diagnosis_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_diagnosis
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_hotfix_dockerfile b/docker/sysom_hotfix_dockerfile
deleted file mode 100644
index ffc3106a..00000000
--- a/docker/sysom_hotfix_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools rpcbind nfs-utils
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_hotfix
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_migration_dockerfile b/docker/sysom_migration_dockerfile
deleted file mode 100644
index e34ec3d2..00000000
--- a/docker/sysom_migration_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools wget
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_migration
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_monitor_server_dockerfile b/docker/sysom_monitor_server_dockerfile
deleted file mode 100644
index a930cc60..00000000
--- a/docker/sysom_monitor_server_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_monitor_server
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_vmcore_dockerfile b/docker/sysom_vmcore_dockerfile
deleted file mode 100644
index 6bbe9548..00000000
--- a/docker/sysom_vmcore_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools rpcbind nfs-utils
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_vmcore
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/docker/sysom_vul_dockerfile b/docker/sysom_vul_dockerfile
deleted file mode 100644
index 378fb79b..00000000
--- a/docker/sysom_vul_dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM openanolis/anolisos:8.8
-
-# Add epel
-RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
-RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
-RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
-
-# Add required yum packages
-RUN yum makecache
-RUN yum install -y supervisor cronie net-tools rpcbind nfs-utils
-RUN systemctl enable crond
-# RUN systemctl enable supervisord
-
-# Init sysom-diagnosis
-ARG SYSOM_HOME=/usr/local/sysom
-ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
-
-RUN mkdir /root/sysom
-COPY conf /root/sysom/conf
-COPY script /root/sysom/script
-COPY infrastructure /root/sysom/infrastructure
-COPY microservice /root/sysom/microservice
-
-RUN bash -x /root/sysom/script/sysom.sh deploy infrastructure env,sdk
-RUN bash -x /root/sysom/script/sysom.sh deploy microservice sysom_vul
-RUN sed "s/nodaemon=false/nodaemon=true/g" -i /etc/supervisord.conf
-
-RUN yum clean all
-
-# # 环境准备
-ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
\ No newline at end of file
diff --git a/environment/0_env/requirements.txt b/environment/0_env/requirements.txt
index fab44e46..917d5365 100644
--- a/environment/0_env/requirements.txt
+++ b/environment/0_env/requirements.txt
@@ -6,6 +6,7 @@ aiofiles==0.8.0
anyio==3.6.2
aiohttp==3.8.4
asyncer==0.0.2
+sqlalchemy==1.4.49
# asyncssh==2.12.0
# autopep8==2.0.0
# channels==3.0.4
diff --git a/environment/1_sdk/sysom_utils/config_parser.py b/environment/1_sdk/sysom_utils/config_parser.py
index 69845937..ef6c9a54 100644
--- a/environment/1_sdk/sysom_utils/config_parser.py
+++ b/environment/1_sdk/sysom_utils/config_parser.py
@@ -9,12 +9,13 @@ Description:
import yaml
from enum import Enum
import os
+from clogger import logger
from .yaml_concat import YamlConcatConstructor
from .adddict import Dict
def dict_merge(dct: dict, merge_dct: dict):
- """ Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
+ """Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
@@ -28,12 +29,35 @@ def dict_merge(dct: dict, merge_dct: dict):
if dct is None or merge_dct is None:
return
for k, v in merge_dct.items():
- if (k in dct and isinstance(dct[k], dict) and isinstance(merge_dct[k], dict)): # noqa
+ if (
+ k in dct and isinstance(dct[k], dict) and isinstance(merge_dct[k], dict)
+ ): # noqa
dict_merge(dct[k], merge_dct[k])
else:
dct[k] = merge_dct[k]
+def get_all_sysom_env_from_proc_1() -> dict:
+ env = {}
+ try:
+ with open("/proc/1/environ", "r") as f:
+ for line in f.readlines():
+ line = line.strip()
+ if line == "":
+ continue
+ envs = line.split("\0")
+ for _env in envs:
+ _env = _env.strip()
+ if _env == "":
+ continue
+ k, v = _env.split("=", 1)
+ if k.startswith("sysom"):
+ env[k] = v
+ except Exception as e:
+ logger.warning(e)
+ return env
+
+
SYSOM_CONFIG_SECTION_GLOBAL = "sysom_global"
SYSOM_CONFIG_SECTION_SERVER = "sysom_server"
SYSOM_CONFIG_SECTION_WEB = "sysom_web"
@@ -49,9 +73,10 @@ ENV_LIST = {
"REDIS_HOST": "sysom_server.db.redis.host",
"REDIS_PORT": "sysom_server.db.redis.port",
"REDIS_USERNAME": "sysom_server.db.redis.username",
- "REDIS_PASSWORD": "sysom_server.db.redis.password"
+ "REDIS_PASSWORD": "sysom_server.db.redis.password",
}
+
class ConfigParserException(Exception):
pass
@@ -68,15 +93,20 @@ class ConfigParser:
self.service_config_path = service_config_path
self._config: Dict = self._load_config()
self._overwrite_from_env()
-
+
def _overwrite_from_env(self) -> None:
+ proc_1_envs = get_all_sysom_env_from_proc_1()
+ for k, v in proc_1_envs.items():
+ key = k.replace("___", ".")
+ self._config.set_multi(key, v)
for env in os.environ:
if env.startswith("sysom"):
- self._config.set_multi(env, os.environ[env])
+ key = env.replace("___", ".")
+ self._config.set_multi(key, os.environ[env])
for env, key_str in ENV_LIST.items():
if os.getenv(env):
self._config.set_multi(key_str, os.getenv(env))
-
+
def _load_config(self) -> Dict:
YamlConcatConstructor.add_to_loader_class(loader_class=yaml.FullLoader)
global_config: dict = {}
@@ -138,7 +168,8 @@ class ConfigParser:
params.append(f"password={redis_config.password}")
else:
raise ConfigParserException(
- f"Not support cec protocol: {cec_config.protocol}")
+ f"Not support cec protocol: {cec_config.protocol}"
+ )
for k in special_param:
params.append(f"{k}={special_param[k]}")
cec_url += "&".join(params)
@@ -165,7 +196,7 @@ class ConfigParser:
params.append(f"{k}={special_param[k]}")
cmg_url += "&".join(params)
return cmg_url
-
+
def get_gcache_url(self) -> str:
service_config = self.get_service_config()
server_config = self.get_server_config()
@@ -188,7 +219,7 @@ class ConfigParser:
params.append(f"{k}={special_param[k]}")
gcache_url += "&".join(params)
return gcache_url
-
+
def get_gclient_url(self, service_name: str) -> str:
service_config = self.get_service_config()
gclient_config = service_config.framework.gclient
@@ -216,7 +247,7 @@ class ConfigParser:
params = [
f"channel_job_target_topic={channel_job_config.target_topic}",
f"channel_job_listen_topic={channel_job_config.listen_topic}",
- f"channel_job_consumer_group={channel_job_config.consumer_group}"
+ f"channel_job_consumer_group={channel_job_config.consumer_group}",
]
if cec_url != "" and cec_url[-1] != "?":
cec_url += "&"
diff --git a/script/server/sysom_ad_proxy/sysom-ad_proxy.ini b/script/server/sysom_ad_proxy/sysom-ad_proxy.ini
index 49ab06ce..c2dc73bd 100644
--- a/script/server/sysom_ad_proxy/sysom-ad_proxy.ini
+++ b/script/server/sysom_ad_proxy/sysom-ad_proxy.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-ad_proxy-error.log
stdout_logfile=/var/log/sysom/sysom-ad_proxy.log
diff --git a/script/server/sysom_alarm/sysom-alarm.ini b/script/server/sysom_alarm/sysom-alarm.ini
index 01254501..63814f08 100644
--- a/script/server/sysom_alarm/sysom-alarm.ini
+++ b/script/server/sysom_alarm/sysom-alarm.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-alarm-error.log
stdout_logfile=/var/log/sysom/sysom-alarm.log
diff --git a/script/server/sysom_alert_pusher/sysom-alert_pusher.ini b/script/server/sysom_alert_pusher/sysom-alert_pusher.ini
index a48518de..4d07c014 100644
--- a/script/server/sysom_alert_pusher/sysom-alert_pusher.ini
+++ b/script/server/sysom_alert_pusher/sysom-alert_pusher.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-alert_pusher-error.log
stdout_logfile=/var/log/sysom/sysom-alert_pusher.log
diff --git a/script/server/sysom_cec_proxy/sysom-cec_proxy.ini b/script/server/sysom_cec_proxy/sysom-cec_proxy.ini
index 265bb419..6fe383ef 100644
--- a/script/server/sysom_cec_proxy/sysom-cec_proxy.ini
+++ b/script/server/sysom_cec_proxy/sysom-cec_proxy.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-cec_proxy-error.log
stdout_logfile=/var/log/sysom/sysom-cec_proxy.log
diff --git a/script/server/sysom_channel/sysom-channel.ini b/script/server/sysom_channel/sysom-channel.ini
index 25d77461..fb78a6b7 100644
--- a/script/server/sysom_channel/sysom-channel.ini
+++ b/script/server/sysom_channel/sysom-channel.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-channel-error.log
stdout_logfile=/var/log/sysom/sysom-channel.log
diff --git a/script/server/sysom_cluster_health/sysom-cluster_health.ini b/script/server/sysom_cluster_health/sysom-cluster_health.ini
index 2f2dd5c0..492815bf 100644
--- a/script/server/sysom_cluster_health/sysom-cluster_health.ini
+++ b/script/server/sysom_cluster_health/sysom-cluster_health.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-cluster_health-error.log
stdout_logfile=/var/log/sysom/sysom-cluster_health.log
diff --git a/script/server/sysom_dingtalk/sysom-dingtalk.ini b/script/server/sysom_dingtalk/sysom-dingtalk.ini
index eaa7b3b7..feee5109 100644
--- a/script/server/sysom_dingtalk/sysom-dingtalk.ini
+++ b/script/server/sysom_dingtalk/sysom-dingtalk.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-dingtalk-error.log
stdout_logfile=/var/log/sysom/sysom-dingtalk.log
diff --git a/script/server/sysom_hotfix/sysom-hotfix.ini b/script/server/sysom_hotfix/sysom-hotfix.ini
index e3f1b324..a3207eae 100644
--- a/script/server/sysom_hotfix/sysom-hotfix.ini
+++ b/script/server/sysom_hotfix/sysom-hotfix.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-hotfix-error.log
stdout_logfile=/var/log/sysom/sysom-hotfix.log
diff --git a/script/server/sysom_knowledge/sysom-knowledge.ini b/script/server/sysom_knowledge/sysom-knowledge.ini
index 8a44014a..5912a9ae 100644
--- a/script/server/sysom_knowledge/sysom-knowledge.ini
+++ b/script/server/sysom_knowledge/sysom-knowledge.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-knowledge-error.log
stdout_logfile=/var/log/sysom/sysom-knowledge.log
diff --git a/script/server/sysom_log/sysom-log.ini b/script/server/sysom_log/sysom-log.ini
index 6e25bf8e..af9f0496 100644
--- a/script/server/sysom_log/sysom-log.ini
+++ b/script/server/sysom_log/sysom-log.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-log-error.log
stdout_logfile=/var/log/sysom/sysom-log.log
diff --git a/script/server/sysom_metric_anomaly_detection/sysom-metric_anomaly_detection.ini b/script/server/sysom_metric_anomaly_detection/sysom-metric_anomaly_detection.ini
index bf4a0c1d..874bc366 100644
--- a/script/server/sysom_metric_anomaly_detection/sysom-metric_anomaly_detection.ini
+++ b/script/server/sysom_metric_anomaly_detection/sysom-metric_anomaly_detection.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-metric_anomaly_detection-error.log
stdout_logfile=/var/log/sysom/sysom-metric_anomaly_detection.log
diff --git a/script/server/sysom_migration/sysom-migration.ini b/script/server/sysom_migration/sysom-migration.ini
index feb252b8..0a7fa185 100644
--- a/script/server/sysom_migration/sysom-migration.ini
+++ b/script/server/sysom_migration/sysom-migration.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-migration-error.log
stdout_logfile=/var/log/sysom/sysom-migration.log
diff --git a/script/server/sysom_monitor_server/sysom-monitor-server.ini b/script/server/sysom_monitor_server/sysom-monitor-server.ini
index cdb4aa60..4f34e85c 100644
--- a/script/server/sysom_monitor_server/sysom-monitor-server.ini
+++ b/script/server/sysom_monitor_server/sysom-monitor-server.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-monitor-server-error.log
stdout_logfile=/var/log/sysom/sysom-monitor-server.log
diff --git a/script/server/sysom_rca/sysom-rca.ini b/script/server/sysom_rca/sysom-rca.ini
index f3338d93..177f5a6a 100644
--- a/script/server/sysom_rca/sysom-rca.ini
+++ b/script/server/sysom_rca/sysom-rca.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-rca-error.log
stdout_logfile=/var/log/sysom/sysom-rca.log
diff --git a/script/server/sysom_vmcore/sysom-vmcore.ini b/script/server/sysom_vmcore/sysom-vmcore.ini
index fcdb24cc..3cfa77a3 100644
--- a/script/server/sysom_vmcore/sysom-vmcore.ini
+++ b/script/server/sysom_vmcore/sysom-vmcore.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-vmcore-error.log
stdout_logfile=/var/log/sysom/sysom-vmcore.log
diff --git a/script/server/sysom_vul/sysom-vul.ini b/script/server/sysom_vul/sysom-vul.ini
index 18ef6a2c..e37dbd51 100644
--- a/script/server/sysom_vul/sysom-vul.ini
+++ b/script/server/sysom_vul/sysom-vul.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/sysom-vul-error.log
stdout_logfile=/var/log/sysom/sysom-vul.log
diff --git a/script/sysom.sh b/script/sysom.sh
index d62beac7..8e1c653d 100755
--- a/script/sysom.sh
+++ b/script/sysom.sh
@@ -1,6 +1,12 @@
#!/bin/bash -x
BaseDir=$(dirname $(readlink -f "$0"))
LocalAppHome=$(dirname $BaseDir)
+
+# Load env from /proc/1/environ
+cat /proc/1/environ | tr '\0' '\n' | awk -F= '{gsub(/\./, "___", $1); print "export \"" $1 "\"=\"" $2 "\""}' > /tmp/proc_1_environ
+source /tmp/proc_1_environ
+rm -f /tmp/proc_1_environ
+
####################################################################################################################
# Initialize environment variables
####################################################################################################################
diff --git a/template/fastapi/scripts/template.ini b/template/fastapi/scripts/template.ini
index 7cd748ed..4f57b5f9 100644
--- a/template/fastapi/scripts/template.ini
+++ b/template/fastapi/scripts/template.ini
@@ -4,6 +4,6 @@ command=/usr/local/sysom/environment/virtualenv/bin/gunicorn -c ./conf/gunicorn.
startsecs=3
autostart=true
autorestart=true
-environment=PATH="/usr/local/sysom/environment/virtualenv/bin/"
+environment=PATH=/usr/local/sysom/virtualenv/bin:%(ENV_PATH)s
stderr_logfile=/var/log/sysom/$TEMPLATE_SERVICE_NAME_MIDDLE-error.log
stdout_logfile=/var/log/sysom/$TEMPLATE_SERVICE_NAME_MIDDLE.log
--
Gitee
From 21c2bb11277e97e7eca7ad046fe9406711d60331 Mon Sep 17 00:00:00 2001
From: SunnyQjm
Date: Tue, 26 Dec 2023 16:54:00 +0800
Subject: [PATCH 037/176] feat(diagnosis): Support diagnosis hook
---
.../sysom_diagnosis/apps/task/helper.py | 41 +++++++++++++
.../sysom_diagnosis/apps/task/urls.py | 1 +
.../sysom_diagnosis/apps/task/views.py | 35 +++++++++++-
.../sysom_diagnosis/service_scripts/base.py | 57 ++++++++++++++++++-
.../service_scripts/command_hook.py | 36 ++++++++++++
5 files changed, 166 insertions(+), 4 deletions(-)
create mode 100644 sysom_server/sysom_diagnosis/service_scripts/command_hook.py
diff --git a/sysom_server/sysom_diagnosis/apps/task/helper.py b/sysom_server/sysom_diagnosis/apps/task/helper.py
index 024e85d5..f7d6e05c 100644
--- a/sysom_server/sysom_diagnosis/apps/task/helper.py
+++ b/sysom_server/sysom_diagnosis/apps/task/helper.py
@@ -20,6 +20,8 @@ from service_scripts.base import (
DiagnosisPreProcessor,
PostProcessResult,
DiagnosisPostProcessor,
+ DiagnosisHookProcessor,
+ HookProcessResult,
)
from service_scripts.wrapper.base import DiagnosisPreProcessorPostWrapperBase
@@ -635,3 +637,42 @@ class DiagnosisHelper:
code=1,
err_msg=f"Diagnosis postprocess error: {str(exc)}",
)
+
+ @staticmethod
+ def invoke_diagnosis_hook(
+ instance: JobModel, hook_params: dict
+ ) -> HookProcessResult:
+ return async_to_sync(DiagnosisHelper.invoke_diagnosis_hook_async)(
+ instance, hook_params
+ )
+
+ @staticmethod
+ async def invoke_diagnosis_hook_async(
+ instance: JobModel, hook_params: dict
+ ) -> HookProcessResult:
+ """Invoke task hook"""
+
+ def _get_diagnosis_hook(service_name: str) -> Type[DiagnosisHookProcessor]:
+ try:
+ return import_module(
+ f"service_scripts.{service_name}_hook"
+ ).HookProcessor
+ except Exception as e:
+ raise Exception(f"No Diagnosis-Hook-Processor available => {str(e)}")
+
+ res = HookProcessResult(code=1, err_msg="Invoke diagnosis hook error", data={})
+ try:
+ # 1. Get params
+ params = instance.params.copy()
+ if isinstance(instance.params, str):
+ try:
+ params = json.loads(instance.params)
+ except Exception as exc:
+ raise Exception(f"Task params loads error: {str(exc)}")
+ service_name = params.get("service_name", "")
+
+ hooker = _get_diagnosis_hook(service_name)(service_name)
+ res = await hooker.invoke_hook(instance, hook_params)
+ except Exception as exc:
+ logger.exception(f"Diagnosis hook invoke error: {str(exc)}")
+ return res
diff --git a/sysom_server/sysom_diagnosis/apps/task/urls.py b/sysom_server/sysom_diagnosis/apps/task/urls.py
index 1c59eeb9..d1151407 100644
--- a/sysom_server/sysom_diagnosis/apps/task/urls.py
+++ b/sysom_server/sysom_diagnosis/apps/task/urls.py
@@ -14,6 +14,7 @@ router = DefaultRouter()
router.register('tasks', views.TaskAPIView)
urlpatterns = [
+ path('api/v1/tasks/task_hook/', views.TaskAPIView.as_view({'post': 'task_hook'})),
path('api/v1/tasks/sbs_task_create/', views.TaskAPIView.as_view({'post': 'sbs_task_create'})),
path('api/v1/tasks/sbs_task_result/', views.TaskAPIView.as_view({'post': 'sbs_task_result'})),
path('api/v1/tasks/offline_import/', views.TaskAPIView.as_view({'post': 'offline_import'})),
diff --git a/sysom_server/sysom_diagnosis/apps/task/views.py b/sysom_server/sysom_diagnosis/apps/task/views.py
index a16fb290..bfad0a81 100644
--- a/sysom_server/sysom_diagnosis/apps/task/views.py
+++ b/sysom_server/sysom_diagnosis/apps/task/views.py
@@ -31,7 +31,12 @@ class TaskAPIView(
):
queryset = JobModel.objects.all().order_by("-created_at")
serializer_class = seriaizer.JobListSerializer
- filter_backends = (IsOwnerFilterBackend, DjangoFilterBackend, SearchFilter, OrderingFilter)
+ filter_backends = (
+ IsOwnerFilterBackend,
+ DjangoFilterBackend,
+ SearchFilter,
+ OrderingFilter,
+ )
search_fields = ("id", "task_id", "created_by__id", "status", "params") # 模糊查询
filterset_class = TaskFilter # 精确查询
authentication_classes = [TokenAuthentication]
@@ -132,7 +137,9 @@ class TaskAPIView(
# 3. Invoke preprocess script
diagnosis_task = DiagnosisHelper.preprocess(instance, True)
response = seriaizer.JobRetrieveSerializer(instance)
- self.produce_event_to_cec(settings.SYSOM_CEC_DIAGNOSIS_TASK_CREATED, response.data)
+ self.produce_event_to_cec(
+ settings.SYSOM_CEC_DIAGNOSIS_TASK_CREATED, response.data
+ )
if diagnosis_task is None:
return ErrorResponse(
msg=f"Preprocess script invoke error: {instance.err_msg}"
@@ -202,6 +209,30 @@ class TaskAPIView(
logger.exception(e)
return ErrorResponse(msg=str(e))
+ def task_hook(self, request, *args, **kwargs):
+ """Invoke task hook
+
+ Args:
+ request (_type_): _description_
+ """
+ try:
+ # 1. Check required params
+ res = self.require_param_validate(request, ["task_id", "params"])
+ if not res["success"]:
+ return ErrorResponse(msg=res.get("message", "Missing parameters"))
+ data = request.data
+ task_id = data.get("task_id", None)
+ params = data.get("params", {})
+ instance = JobModel.objects.get(task_id=task_id)
+ res = DiagnosisHelper.invoke_diagnosis_hook(instance, params)
+ if res.code == 200:
+ return success(res.data)
+ else:
+ return ErrorResponse(msg=res.err_msg)
+ except Exception as e:
+ logger.exception(e)
+ return ErrorResponse(msg=str(e))
+
def offline_import(self, request, *args, **kwargs):
"""Offline import of diagnosis logs"""
try:
diff --git a/sysom_server/sysom_diagnosis/service_scripts/base.py b/sysom_server/sysom_diagnosis/service_scripts/base.py
index 9bd5b197..19fb9a07 100644
--- a/sysom_server/sysom_diagnosis/service_scripts/base.py
+++ b/sysom_server/sysom_diagnosis/service_scripts/base.py
@@ -7,6 +7,8 @@ Description:
"""
from abc import ABC, abstractmethod
from typing import List, Optional, Union
+from apps.task.models import JobModel
+from asgiref.sync import sync_to_async
class FileItem:
@@ -19,7 +21,7 @@ class FileItem:
return {
"name": self.name,
"remote_path": self.remote_path,
- "local_path": self.local_path
+ "local_path": self.local_path,
}
@@ -44,7 +46,11 @@ class DiagnosisJob:
return DiagnosisJob(instance=data.get("instance", ""), cmd=data.get("cmd", ""))
def to_dict(self):
- return {"instance": self.instance, "cmd": self.cmd, "fetch_file_list": [item.to_dict() for item in self.fetch_file_list]}
+ return {
+ "instance": self.instance,
+ "cmd": self.cmd,
+ "fetch_file_list": [item.to_dict() for item in self.fetch_file_list],
+ }
class DiagnosisTask:
@@ -191,3 +197,50 @@ class DiagnosisPostProcessor(DiagnosisProcessorBase):
Args:
results (List[DiagnosisResult]): Diagnosis results
"""
+
+
+class HookProcessResult:
+ def __init__(self, code: int, data: dict, err_msg: str = "") -> None:
+ self.code = code
+ self.data = data
+ self.err_msg = err_msg
+
+ def to_dict(self):
+ return {"code": self.code, "data": self.data, "err_msg": self.err_msg}
+
+ @classmethod
+ def from_dict(cls, data: dict) -> "HookProcessResult":
+ return HookProcessResult(
+ code=data.get("code", 1),
+ data=data.get("data", ""),
+ err_msg=data.get("err_msg", ""),
+ )
+
+
+class DiagnosisHookProcessor(DiagnosisProcessorBase):
+ """Hook-processor used to invoke hook scripts
+
+ Args:
+ DiagnosisProcessorBase (_type_): _description_
+ """
+
+ def __init__(self, service_name: str, **kwargs):
+ self.service_name = service_name
+
+ async def save_job(self, instance: JobModel):
+ try:
+ await sync_to_async(instance.save)()
+ except Exception as e:
+ raise e
+
+ @abstractmethod
+ async def invoke_hook(self, instance: JobModel, params: dict) -> HookProcessResult:
+ """Invoke hook scripts
+
+ Args:
+ params (dict): Diagnosis parameters
+
+ Returns:
+ HookProcessResult: Hook process result
+ """
+ return HookProcessResult(code=200, data={}, err_msg="")
diff --git a/sysom_server/sysom_diagnosis/service_scripts/command_hook.py b/sysom_server/sysom_diagnosis/service_scripts/command_hook.py
new file mode 100644
index 00000000..f43033ca
--- /dev/null
+++ b/sysom_server/sysom_diagnosis/service_scripts/command_hook.py
@@ -0,0 +1,36 @@
+"""
+Time 2023/06/19 17:32
+Author: mingfeng (SunnyQjm)
+Email mfeng@linux.alibaba.com
+File command.py
+Description:
+"""
+import json
+from apps.task.models import JobModel
+from clogger import logger
+from .base import HookProcessResult, DiagnosisHookProcessor
+
+class HookProcessor(DiagnosisHookProcessor):
+ """Hook-processor used to invoke hook scripts
+
+ Args:
+ DiagnosisProcessorBase (_type_): _description_
+ """
+
+ async def invoke_hook(self, instance: JobModel, params: dict) -> HookProcessResult:
+ """Invoke hook scripts
+
+ Args:
+ params (dict): Diagnosis parameters
+
+ Returns:
+ HookProcessResult: Hook process result
+ """
+ replace_text = params.get("replace_text", "")
+
+ origin_result = json.loads(instance.result)
+ origin_result["CommandResult"]["data"][0] = {"key": "", "value": replace_text}
+
+ instance.result = json.dumps(origin_result)
+ await self.save_job(instance)
+ return HookProcessResult(code=200, data={}, err_msg="")
\ No newline at end of file
--
Gitee
From 2f525e1728808a6987c2ba615f6309da16d1d513 Mon Sep 17 00:00:00 2001
From: wb-msm261421
Date: Tue, 26 Dec 2023 17:43:44 +0800
Subject: [PATCH 038/176] feat(web.diagnose): sbs offline task result, one
click copy command
---
.../resource/diagnose/v2/multichannel.json | 22 +++++
sysom_web/src/locales/zh-CN/pages.js | 5 +
.../pages/diagnose/components/TaskList.jsx | 97 ++++++++++++++++---
.../components/UploadResultFormModal.jsx | 86 ++++++++++++++++
sysom_web/src/pages/diagnose/service.js | 19 ++++
5 files changed, 213 insertions(+), 16 deletions(-)
create mode 100644 sysom_web/src/pages/diagnose/components/UploadResultFormModal.jsx
diff --git a/sysom_web/public/resource/diagnose/v2/multichannel.json b/sysom_web/public/resource/diagnose/v2/multichannel.json
index b956ca6a..a21269f6 100644
--- a/sysom_web/public/resource/diagnose/v2/multichannel.json
+++ b/sysom_web/public/resource/diagnose/v2/multichannel.json
@@ -15,6 +15,28 @@
}
]
}
+ },
+ {
+ "name": "offline",
+ "label": "离线通道",
+ "extra_params": {
+ "*": [
+ {
+ "type": "text",
+ "name": "channel",
+ "initialValue": "offline",
+ "label": "离线通道",
+ "disabled": true
+ },
+ {
+ "type": "text",
+ "name": "sysom_preprocess_post_wrapper",
+ "initialValue": "offline",
+ "label": "命令包装器",
+ "disabled": false
+ }
+ ]
+ }
}
]
}
\ No newline at end of file
diff --git a/sysom_web/src/locales/zh-CN/pages.js b/sysom_web/src/locales/zh-CN/pages.js
index 75faeb49..d6fca953 100644
--- a/sysom_web/src/locales/zh-CN/pages.js
+++ b/sysom_web/src/locales/zh-CN/pages.js
@@ -415,6 +415,11 @@ export default {
'pages.diagnose.viewdiagnosisresults': '查看诊断结果',
'pages.diagnose.viewdiagnosisdetail': '查看诊断详情',
'pages.diagnose.viewerrormessages': '查看出错信息',
+ 'page.diagnose.copycommand': 'copy 命令',
+ 'pages.diagnose.uploadtaskresult': '上传结果',
+ 'pages.diagnose.uploadtaskresultfrom': '上传任务结果表单',
+ 'pages.diagnose.offlinetaskresult': '离线任务结果',
+ 'pages.diagnose.offlinetaskresultannex': '离线任务附件',
'pages.diagnose.nooperation': '暂无可用操作',
'pages.diagnose.checkitem': '检查项目',
'pages.diagnose.normal': '正常',
diff --git a/sysom_web/src/pages/diagnose/components/TaskList.jsx b/sysom_web/src/pages/diagnose/components/TaskList.jsx
index a5a1c034..e44daf98 100644
--- a/sysom_web/src/pages/diagnose/components/TaskList.jsx
+++ b/sysom_web/src/pages/diagnose/components/TaskList.jsx
@@ -2,12 +2,46 @@ import React from "react";
import ProTable from "@ant-design/pro-table";
import { useState, useRef, useImperativeHandle } from 'react';
import { getTaskList } from "../service";
-import { Tag, Space, Tabs } from 'antd';
+import { Tag, Space, Tabs, Col, Row, Typography, message } from 'antd';
import { useRequest, useIntl, FormattedMessage } from 'umi';
import { JsonView, allExpanded, darkStyles, defaultStyles } from 'react-json-view-lite';
+import UploadResultFormModal from './UploadResultFormModal'
import 'react-json-view-lite/dist/index.css';
import _ from "lodash";
+const { Paragraph } = Typography;
+
+const boxStyle = {
+ width: '100%',
+ height: 60,
+ border: '1px solid #40a9ff',
+ borderRadius: '8px',
+ margin: '10px 0'
+}
+
+const CommandCopy = (props) => {
+ const { record } = props
+ return
+ {
+ record.command.jobs.map((item) => {
+ return
+
+ {item.cmd}
+
+
+ })
+ }
+
+}
const TaskList = React.forwardRef((props, ref) => {
const actionRef = useRef([]);
@@ -68,6 +102,31 @@ const TaskList = React.forwardRef((props, ref) => {
valueType: "option",
render: (_, record) => {
let operations = [];
+
+ // one click command copy
+ if (record.channel == "offline") {
+ operations.push(
+ {
+ // Step one splicing jobs command, use '\ n' to split
+ let commandText = new String("");
+ for (let key in record.command.jobs) { commandText += `${record.command.jobs[key].cmd} \n` }
+
+ // Step two create virtually document element input
+ let oInput = document.createElement('input')
+ oInput.value = commandText;
+ document.body.appendChild(oInput)
+ oInput.select() // 选择对象
+ document.execCommand("Copy") // 执行浏览器复制命令
+ oInput.remove()
+
+ // Step three tip copy message
+ message.success("command copy success!")
+ }}>
+
+
+ )
+ }
+
if (record.status == "Success") {
operations.push(
{
@@ -75,6 +134,9 @@ const TaskList = React.forwardRef((props, ref) => {
}}>
)
}
+ else if (record.status == "Running" && props.channel == "offline") {
+ operations.push( { ref.current?.reload() }} />)
+ }
else if (record.status == "Fail") {
operations.push(
{
@@ -164,24 +226,27 @@ const TaskList = React.forwardRef((props, ref) => {
})
}
return (
- {
- setCurrentTabs((preState) => {
- return {
- ...preState,
- [record.task_id]: key
- }
- });
- }}
- />
+ <>
+ {props.channel === "offline" ? : <>>}
+ {
+ setCurrentTabs((preState) => {
+ return {
+ ...preState,
+ [record.task_id]: key
+ }
+ });
+ }}
+ />
+ >
//
+ // }} />