diff --git a/ozhera-monitor/ozhera-monitor-common/src/main/java/com/xiaomi/mone/monitor/DashboardConstant.java b/ozhera-monitor/ozhera-monitor-common/src/main/java/com/xiaomi/mone/monitor/DashboardConstant.java index b31beef5a..44b9fd9ee 100644 --- a/ozhera-monitor/ozhera-monitor-common/src/main/java/com/xiaomi/mone/monitor/DashboardConstant.java +++ b/ozhera-monitor/ozhera-monitor-common/src/main/java/com/xiaomi/mone/monitor/DashboardConstant.java @@ -33,7 +33,7 @@ public class DashboardConstant { public static final String DEFAULT_GOLANG_ID_LIST = "110,148,152,112,116,120,124,128,132,134," + "136,138,140,142,144,146,66,95,96,50,82,68,78,102,104,106,146,159,170,171," + "172,173,174,150,126,130,122,118,163,169,168"; - public static final String DEFAULT_JAEGER_QUERY_JOB_NAME = "jaeger_query"; + public static final String DEFAULT_JAEGER_QUERY_JOB_NAME = "jaeger-query"; public static final String DEFAULT_JVM_JOB_NAME = "mione-yewujiankong-china-jvm"; public static final String DEFAULT_DOCKER_JOB_NAME = "mione-china-cadvisor-k8s"; public static final String DEFAULT_NODE_JOB_NAME = "mione-china-node-k8s"; diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/HeraDashboardService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/HeraDashboardService.java index 0f8f6fad6..d0f7ccf7c 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/HeraDashboardService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/com/xiaomi/mone/monitor/service/HeraDashboardService.java @@ -71,6 +71,12 @@ public class HeraDashboardService { @NacosValue(value = "${prometheus.url}", autoRefreshed = true) private String prometheusUrl; + @NacosValue(value = "${grafana.username}", autoRefreshed = true) + private String grafanaUserName; + + @NacosValue(value = "${grafana.password}", autoRefreshed = true) + private String grafanaPassword; + @PostConstruct public void init() { try { @@ -82,10 +88,10 @@ public void init() { dataSourceDTO.setPrometheusDatasource(prometheusUrl); } if (StringUtils.isBlank(dataSourceDTO.getUsername())) { - dataSourceDTO.setUsername(DashboardConstant.GRAFANA_USER_NAME); + dataSourceDTO.setUsername(grafanaUserName); } if (StringUtils.isBlank(dataSourceDTO.getPassword())) { - dataSourceDTO.setPassword(DashboardConstant.GRAFANA_PASSWORD); + dataSourceDTO.setPassword(grafanaPassword); } if (StringUtils.isBlank(dataSourceDTO.getDashboardFolderName())) { dataSourceDTO.setDashboardFolderName(DashboardConstant.DEFAULT_FOLDER_NAME); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerMarket.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerMarket.ftl index 63dce8fe9..39423ea66 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerMarket.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerMarket.ftl @@ -83,7 +83,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serviceName=\"$serviceName\"}[30s])/30) by (methodName,serverIp)) by (methodName)", +"expr": "sum(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serviceName=\"$serviceName\",serverEnv=~\"$env\"}[30s])/30) by (methodName,serverIp)) by (methodName)", "interval": "", "legendFormat": "{{methodName}}", "refId": "A" @@ -174,7 +174,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serviceName=\"$serviceName\"}[30s])) by (le,methodName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serviceName=\"$serviceName\",serverEnv=~\"$env\"}[30s])) by (le,methodName))", "interval": "", "legendFormat": "{{methodName}}", "refId": "A" @@ -326,6 +326,38 @@ "type": "interval" }, { +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, +{ "current": { "selected": false, "text": "com.xiaomi.youpin.diamond.dashboard.api.service.PushResourceService", @@ -370,5 +402,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-DubboConsumer大盘V1.0" +"message":"Hera-DubboConsumer大盘V1.1" } \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerOverview.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerOverview.ftl index 81037d765..a19a64d2a 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerOverview.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboConsumerOverview.ftl @@ -172,7 +172,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange]))", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "instant": true, "interval": "", @@ -185,7 +185,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_dubboBisSuccessCount_total{application=\"$application\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])),1)", +"expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_dubboBisSuccessCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])),1)", "format": "table", "hide": false, "instant": true, @@ -199,7 +199,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[${query0}s])/${query0})", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0})", "format": "table", "hide": false, "instant": true, @@ -213,7 +213,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange]))", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "hide": false, "instant": true, @@ -227,7 +227,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le))", +"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -241,7 +241,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -588,7 +588,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName))", "format": "table", "hide": false, "instant": true, @@ -603,7 +603,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[${query0}s])/${query0}) by (serviceName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0}) by (serviceName)", "format": "table", "hide": false, "instant": true, @@ -618,7 +618,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (serviceName)) / (sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (serviceName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (serviceName))+1", +"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName)) / (sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (serviceName))+1", "format": "table", "hide": false, "instant": true, @@ -633,7 +633,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (serviceName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (serviceName))", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (serviceName))", "format": "table", "hide": false, "instant": true, @@ -648,7 +648,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName))", +"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName))", "format": "table", "hide": false, "instant": true, @@ -663,7 +663,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (serviceName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName)", "format": "table", "hide": false, "instant": true, @@ -1021,7 +1021,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName,methodName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName,methodName))", "format": "table", "hide": false, "instant": true, @@ -1035,7 +1035,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[${query0}s])/${query0}) by (methodName,serviceName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0}) by (methodName,serviceName)", "format": "table", "hide": false, "instant": true, @@ -1050,7 +1050,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", +"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", "format": "table", "hide": false, "instant": true, @@ -1065,7 +1065,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (methodName))", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboConsumerError_total{application=\"$application\"}[$timeRange])) by (methodName))", "format": "table", "hide": false, "instant": true, @@ -1079,7 +1079,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName,methodName))", +"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboConsumerTimeCost_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName,methodName))", "format": "table", "hide": false, "instant": true, @@ -1093,7 +1093,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\"}[$timeRange])) by (methodName,serviceName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboBisTotalCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName,serviceName)", "format": "table", "hide": false, "instant": true, @@ -1189,6 +1189,38 @@ "useTags": false }, { +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, +{ "auto": true, "auto_count": 1, "auto_min": "10s", @@ -1298,5 +1330,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-DubboConsumer总览V1.0" +"message":"Hera-DubboConsumer总览V1.1" } \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderMarket.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderMarket.ftl index 0f64fcfc3..c7e8b56ea 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderMarket.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderMarket.ftl @@ -83,7 +83,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serviceName=\"$serviceName\"}[30s])/30) by (methodName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serviceName=\"$serviceName\",serverEnv=~\"$env\"}[30s])/30) by (methodName)", "interval": "", "legendFormat": "{{methodName}}", "refId": "A" @@ -174,7 +174,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serviceName=\"$serviceName\"}[30s])) by (le,methodName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serviceName=\"$serviceName\",serverEnv=~\"$env\"}[30s])) by (le,methodName))", "interval": "", "legendFormat": "{{methodName}}", "refId": "A" @@ -253,6 +253,38 @@ "useTags": false }, { +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, +{ "current": { "selected": false, "text": "com.xiaomi.youpin.diamond.push.api.service.HaishenDataService", @@ -300,5 +332,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-DubboProvider大盘V1.0" +"message":"Hera-DubboProvider大盘V1.1" } \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderOverview.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderOverview.ftl index fcc3ae3cd..eaf4a3390 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderOverview.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/dubboProviderOverview.ftl @@ -172,7 +172,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange]))", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "instant": true, "interval": "", @@ -185,7 +185,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledSuccessCount_total{application=\"$application\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])),1)", + "expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledSuccessCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])),1)", "format": "table", "hide": false, "instant": true, @@ -199,7 +199,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[${query0}s])/${query0})", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0})", "format": "table", "hide": false, "instant": true, @@ -213,7 +213,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange]))", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "hide": false, "instant": true, @@ -227,7 +227,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le))", + "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -241,7 +241,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le))", + "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -588,7 +588,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName))", + "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName))", "format": "table", "hide": false, "instant": true, @@ -602,7 +602,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[${query0}s])/${query0}) by (serviceName)", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0}) by (serviceName)", "format": "table", "hide": false, "instant": true, @@ -617,7 +617,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (serviceName)) / (sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (serviceName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (serviceName))+1\n", + "expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName)) / (sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (serviceName))+1\n", "format": "table", "hide": false, "instant": true, @@ -632,7 +632,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (serviceName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (serviceName))", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName))", "format": "table", "hide": false, "instant": true, @@ -647,7 +647,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName))", + "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName))", "format": "table", "hide": false, "instant": true, @@ -661,7 +661,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (serviceName)", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (serviceName)", "format": "table", "hide": false, "instant": true, @@ -1019,7 +1019,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName,methodName))", + "expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName,methodName))", "format": "table", "hide": false, "instant": true, @@ -1033,7 +1033,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[${query0}s])/${query0}) by (methodName,serviceName)", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0}) by (methodName,serviceName)", "format": "table", "hide": false, "instant": true, @@ -1048,7 +1048,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", + "expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", "format": "table", "hide": false, "instant": true, @@ -1063,7 +1063,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (methodName))", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_dubboProviderError_total{application=\"$application\"}[$timeRange])) by (methodName))", "format": "table", "hide": false, "instant": true, @@ -1077,7 +1077,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\"}[$timeRange])) by (le,serviceName,methodName))", + "expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_dubboProviderCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,serviceName,methodName))", "format": "table", "hide": false, "instant": true, @@ -1091,7 +1091,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, - "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\"}[$timeRange])) by (methodName,serviceName)", + "expr": "sum(sum_over_time(${env}_${serviceName}_dubboMethodCalledCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName,serviceName)", "format": "table", "hide": false, "instant": true, @@ -1186,6 +1186,38 @@ "type": "query", "useTags": false }, +{ +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, { "auto": true, "auto_count": 1, @@ -1297,5 +1329,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-DubboProvider总览V1.0" +"message":"Hera-DubboProvider总览V1.1" } \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerMarket.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerMarket.ftl index 721e3dab8..592ebbf49 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerMarket.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerMarket.ftl @@ -85,7 +85,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[30s])/30) by (methodName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[30s])/30) by (methodName)", "format": "time_series", "hide": false, "instant": false, @@ -180,7 +180,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\"}[30s])) by (le,methodName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[30s])) by (le,methodName))", "interval": "", "legendFormat": "{{url}}", "refId": "A" @@ -255,6 +255,38 @@ "useTags": false }, { +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, +{ "auto": true, "auto_count": 1, "auto_min": "10s", @@ -394,5 +426,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-HTTPServer大盘V1.0" +"message":"Hera-HTTPServer大盘V1.1" } \ No newline at end of file diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerOverview.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerOverview.ftl index 1b3208333..389080648 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerOverview.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/httpServerOverview.ftl @@ -173,7 +173,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange]))", +"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "instant": true, "interval": "", @@ -186,7 +186,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_aopSuccessMethodCount_total{application=\"$application\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange])),1)", +"expr": "clamp_max(sum(sum_over_time(${env}_${serviceName}_aopSuccessMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) / \nsum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])),1)", "format": "table", "hide": false, "instant": true, @@ -200,7 +200,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[${query0}s])/${query0})", +"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0})", "format": "table", "hide": false, "instant": true, @@ -214,7 +214,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\"}[$timeRange]))", +"expr": "sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange]))", "format": "table", "hide": false, "instant": true, @@ -228,7 +228,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\"}[$timeRange])) by (le))", +"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -242,7 +242,7 @@ "uid": "${prometheusUid}" }, "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\"}[$timeRange])) by (le))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le))", "format": "table", "hide": false, "instant": true, @@ -590,7 +590,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\"}[$timeRange])) by (le,methodName))", +"expr": "histogram_quantile(0.99,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,methodName))", "format": "table", "hide": false, "instant": true, @@ -605,7 +605,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[${query0}s])/${query0}) by (methodName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[${query0}s])/${query0}) by (methodName)", "format": "table", "hide": false, "instant": true, @@ -620,7 +620,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", +"expr": "(1 - ((sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName)) / (sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName))) )or 0*(sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange])) by (methodName))+1", "format": "table", "hide": false, "instant": true, @@ -635,7 +635,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\"}[$timeRange])) by (methodName) )", +"expr": "sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName) or 0*absent(sum(sum_over_time(${env}_${serviceName}_httpError_total{application=\"$application\"}[$timeRange])) by (methodName) )", "format": "table", "hide": false, "instant": true, @@ -650,7 +650,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\"}[$timeRange])) by (le,methodName))", +"expr": "histogram_quantile(0.95,sum(sum_over_time(${env}_${serviceName}_aopMethodTimeCount_bucket{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (le,methodName))", "format": "table", "hide": false, "instant": true, @@ -665,7 +665,7 @@ }, "editorMode": "code", "exemplar": true, -"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\"}[$timeRange])) by (methodName)", +"expr": "sum(sum_over_time(${env}_${serviceName}_aopTotalMethodCount_total{application=\"$application\",serverEnv=~\"$env\"}[$timeRange])) by (methodName)", "format": "table", "hide": false, "instant": true, @@ -762,6 +762,38 @@ "useTags": false }, { +"allValue": ".*", +"current": { +"selected": true, +"text": [ +"All" +], +"value": [ +"$__all" +] +}, +"datasource": { +"type": "prometheus", +"uid": "${prometheusUid}" +}, +"definition": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"hide": 0, +"includeAll": true, +"label": "环境", +"multi": true, +"name": "env", +"options": [], +"query": { +"query": "label_values(container_last_seen{application=\"$application\"},serverEnv)", +"refId": "StandardVariableQuery" +}, +"refresh": 1, +"regex": "", +"skipUrlSync": false, +"sort": 0, +"type": "query" +}, +{ "auto": true, "auto_count": 1, "auto_min": "10s", @@ -872,5 +904,5 @@ }, "overwrite":true, "folderUid":"Hera", -"message":"Hera-HTTPServer-总览V1.0" +"message":"Hera-HTTPServer-总览V1.1" } \ No newline at end of file diff --git a/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/nacos/config/mimonitor_open_config_#_DEFAULT_GROUP.properties b/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/nacos/config/mimonitor_open_config_#_DEFAULT_GROUP.properties index a88eb3355..acd2e1b64 100644 --- a/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/nacos/config/mimonitor_open_config_#_DEFAULT_GROUP.properties +++ b/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/nacos/config/mimonitor_open_config_#_DEFAULT_GROUP.properties @@ -99,6 +99,8 @@ grafana.datasource.url=/api/datasources grafana.jaeger.query.token=adqSWsad19E8D4 grafana.backend.users=xx prometheusUid=f6Lhk8A4z +grafana.username=xxx +grafana.password=xxx hera.dash.url=http://${hera.homepage.url}/project-target-monitor/application/dash-board cn.grafana.url=http://${hera.grafana.url}/d/tFjrMVeGz/zhong-guo-qu-staging-rong-qi-jian-kong diff --git a/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/vmCluster/vm-k8s-yaml/vmAgent.yaml b/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/vmCluster/vm-k8s-yaml/vmAgent.yaml index c3952675d..f3dd628f9 100644 --- a/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/vmCluster/vm-k8s-yaml/vmAgent.yaml +++ b/ozhera-operator/ozhera-operator-server/src/main/resources/ozhera_init/vmCluster/vm-k8s-yaml/vmAgent.yaml @@ -129,6 +129,6 @@ metadata: data: scrape.yml: | global: - scrape_interval: 10s + scrape_interval: 30s scrape_config_files: - http://prometheus-agent-independent.ozhera-namespace/api/v1/vm/reloadScrapeJob