Skip to content

Commit

Permalink
feat: interface disk add env Filter box (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
wodiwudi authored Mar 1, 2024
1 parent 073ba3b commit 7430a66
Show file tree
Hide file tree
Showing 10 changed files with 264 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -370,5 +402,5 @@
},
"overwrite":true,
"folderUid":"Hera",
"message":"Hera-DubboConsumer大盘V1.0"
"message":"Hera-DubboConsumer大盘V1.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1298,5 +1330,5 @@
},
"overwrite":true,
"folderUid":"Hera",
"message":"Hera-DubboConsumer总览V1.0"
"message":"Hera-DubboConsumer总览V1.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -300,5 +332,5 @@
},
"overwrite":true,
"folderUid":"Hera",
"message":"Hera-DubboProvider大盘V1.0"
"message":"Hera-DubboProvider大盘V1.1"
}
Loading

0 comments on commit 7430a66

Please sign in to comment.