From 0aaff6d288ec957c66e3fc7133382af773c63cbe Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 30 Dec 2024 10:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=832.0.13=E7=89=88=E6=9C=AC=20(#?= =?UTF-8?q?73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 发布2.0.13版本 --- README_cn.md | 106 +- collector/bms.go | 1 - collector/bms_test.go | 2 +- collector/cc.go | 20 +- collector/cc_test.go | 15 +- collector/collector.go | 13 +- collector/collector_test.go | 25 +- collector/common.go | 9 +- collector/config.go | 13 +- collector/ecs.go | 1 - collector/ecs_test.go | 2 +- collector/extensions.go | 1 + collector/metrics.go | 22 +- collector/rms.go | 2 + collector/utils.go | 18 + collector/utils_test.go | 32 + collector/version.go | 2 +- collector/waf.go | 8 +- endpoints.yml | 6 +- .../templates/rds_dashboard_template.json | 3124 +++++++++-------- .../templates/vpc_dashboard_template.json | 255 +- .../templates/waf_dashboard_template.json | 1856 +++++----- ...f_premium_instance_dashboard_template.json | 1755 ++++----- grafana_dashboard/use_grafana_template.md | 16 +- logs/logs.go | 23 +- main.go | 50 +- metric.yml | 12 +- 27 files changed, 3722 insertions(+), 3667 deletions(-) diff --git a/README_cn.md b/README_cn.md index e09e85bb..01c449f6 100644 --- a/README_cn.md +++ b/README_cn.md @@ -60,6 +60,7 @@ Prometheus是用于展示大型测量数据的开源可视化工具,在工业 |事件网格|SYS.EG|√|RMS| |对象存储服务|SYS.OBS|√|RMS| |云解析服务|SYS.DNS|√|云服务| +|企业门户|SYS.EWP|√|云服务| 注:自定义标签时,key只能包含大写字母、小写字母以及中划线 @@ -98,6 +99,7 @@ global: metrics_conf_path: "/root/metric.yml" # 可选配置,指定指标配置文件路径,建议使用绝对路径。若未指定,程序将默认使用执行启动命令所在目录下的指标配置文件。 endpoints_conf_path: "/root/endpoints.yml" # 可选配置,指定服务域名配置文件路径,建议使用绝对路径。若未指定,程序将默认使用执行启动命令所在目录下的服务域名配置文件。 ignore_ssl_verify: false # 可选配置,exporter查询资源/指标时默认校验ssl证书;若用户因ssl证书校验导致功能异常,可将该配置项配置为true跳过ssl证书校验 + client_cn: "" # 可选配置,指定被信任的DNS列表,用于校验https证书链中的DNS名称,列表中多个DNS名称请以逗号分隔 # 可选配置,根据实际情况替换示例中的代理协议、地址和端口号 proxy_schema: "http" @@ -131,19 +133,106 @@ auth: ./cloudeye-exporter -config=clouds.yml ``` -4.1 出于安全考虑cloudeye-exporter提供了 -s参数, 可以通过命令行交互的方式输入ak sk避免明文配置在clouds.yml文件中引起泄露 +4.1 出于安全考虑cloudeye-exporter提供了-s参数, 可以通过命令行交互的方式输入ak sk避免明文配置在clouds.yml文件中引起泄露。 ```shell ./cloudeye-exporter -s true ``` -下面是shell脚本启动的样例,建议在脚本中配置加密后的ak&sk,并通过您自己的解密方法对ak sk进行解密后通过huaweiCloud_AK和huaweiCloud_SK参数传入cloudeye-exporter +下面是shell脚本启动的样例,建议在脚本中配置加密后的ak&sk,并通过您自己的解密方法对ak sk进行解密后通过huaweiCloud_AK和huaweiCloud_SK参数传入cloudeye-exporter。 ```shell #!/bin/bash ## 为了防止您的ak&sk泄露,不建议在脚本中配置明文的ak sk huaweiCloud_AK=your_decrypt_function("加密的AK") huaweiCloud_SK=your_decrypt_function("加密的SK") -$(./cloudeye-exporter -s true< $root_path << EOF +$huaweiCloud_https_ca +EOF +# https证书写入证书临时文件,exporter读取完毕后会自动删除 +cat > $server_crt_path << EOF +$huaweiCloud_https_crt +EOF +# 私钥写入私钥临时文件,exporter读取完毕后会自动删除 +cat > $server_key_path << EOF +$huaweiCloud_https_key +EOF +# 请不要将原始证书路径和私钥路径作为exporter启动参数,以免被exporter删除 +./cloudeye-exporter -k true< $root_path << EOF +$huaweiCloud_https_ca +EOF +# https证书写入证书临时文件,exporter读取完毕后会自动删除 +cat > $server_crt_path << EOF +$huaweiCloud_https_crt +EOF +# 私钥写入私钥临时文件,exporter读取完毕后会自动删除 +cat > $server_key_path << EOF +$huaweiCloud_https_key +EOF +./cloudeye-exporter -s=true -p=true -k=true<%s", getDefaultString((*bandwidth.InterRegions)[0].LocalRegionId), getDefaultString((*bandwidth.InterRegions)[0].RemoteRegionId)), getDefaultString(&bandwidth.Name)) + for _, interRegion := range *bandwidth.InterRegions { + regionBandWidthIds = append(regionBandWidthIds, interRegion.Id) + } + } + + for _, regionBandWidthId := range regionBandWidthIds { + metrics := buildDimensionMetrics(metricNames, CCNamespace, + []cesmodel.MetricsDimension{{Name: "cloud_connect_id", Value: bandwidth.CloudConnectionId}, + {Name: "bwp_id", Value: bandwidth.BandwidthPackageId}, + {Name: "region_bandwidth_id", Value: regionBandWidthId}}) + filterMetrics = append(filterMetrics, metrics...) + resourceInfos[GetResourceKeyFromMetricInfo(metrics[0])] = info } - resourceInfos[GetResourceKeyFromMetricInfo(metrics[0])] = info } return resourceInfos, filterMetrics } diff --git a/collector/cc_test.go b/collector/cc_test.go index 40da6927..d88575dc 100644 --- a/collector/cc_test.go +++ b/collector/cc_test.go @@ -11,9 +11,15 @@ import ( ) func TestCCGetResourceInfo(t *testing.T) { - sysConfig := map[string][]string{CCConfigDimNames: {"network_incoming_bits_rate"}} patches := getPatches() - patches.ApplyFuncReturn(getMetricConfigMap, sysConfig) + defer patches.Reset() + metricConf = map[string]MetricConf{ + CCNamespace: { + DimMetricName: map[string][]string{ + CCConfigDimNames: {"network_incoming_bits_rate"}, + }, + }, + } logs.InitLog("") defaultEpId := "0" id := "connection-0001" @@ -42,7 +48,6 @@ func TestCCGetResourceInfo(t *testing.T) { patches.ApplyMethodFunc(&ccClient, "ListBandwidthPackages", func(req *model.ListBandwidthPackagesRequest) (*model.ListBandwidthPackagesResponse, error) { return &packagesPage, nil }) - defer patches.Reset() localRegionId := "cn-test-01" remoteRegionId := "cn-test-02" @@ -55,7 +60,7 @@ func TestCCGetResourceInfo(t *testing.T) { CloudConnectionId: id, BandwidthPackageId: id, InterRegions: &[]model.InterRegion{ - {LocalRegionId: &localRegionId, RemoteRegionId: &remoteRegionId}, + {Id: id, LocalRegionId: &localRegionId, RemoteRegionId: &remoteRegionId}, }}, }, PageInfo: &model.PageInfo{}, @@ -63,12 +68,12 @@ func TestCCGetResourceInfo(t *testing.T) { patches.ApplyMethodFunc(&ccClient, "ListInterRegionBandwidths", func(req *model.ListInterRegionBandwidthsRequest) (*model.ListInterRegionBandwidthsResponse, error) { return &bandwidthsPage, nil }) - defer patches.Reset() var ccgetter CCInfo labels, metrics := ccgetter.GetResourceInfo() assert.Equal(t, 1, len(labels)) assert.Equal(t, 1, len(metrics)) + metricConf = map[string]MetricConf{} } func TestGetCCClient(t *testing.T) { diff --git a/collector/collector.go b/collector/collector.go index dd08ad4c..1631402e 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -134,15 +134,15 @@ func getDimLabel(metric model.BatchMetricData) labelInfo { var label labelInfo for _, dim := range *metric.Dimensions { label.Name = append(label.Name, strings.ReplaceAll(dim.Name, "-", "_")) - label.Value = append(label.Value, getDimValue(*metric.Namespace, dim.Name, dim.Value)) + label.Value = append(label.Value, getDimValue(metric, dim.Name, dim.Value)) } label.Name = append(label.Name, "unit") label.Value = append(label.Value, *metric.Unit) return label } -func getDimValue(namespaces, dimName, dimValue string) string { - if !isContainsInStringArr(namespaces, []string{"AGT.ECS", "SERVICE.BMS"}) { +func getDimValue(metricData model.BatchMetricData, dimName, dimValue string) string { + if !isContainsInStringArr(*metricData.Namespace, []string{"AGT.ECS", "SERVICE.BMS"}) { return dimValue } @@ -150,7 +150,12 @@ func getDimValue(namespaces, dimName, dimValue string) string { return dimValue } - return getAgentOriginValue(dimValue) + instanceID := getServerResourceKey(metricData) + if instanceID == "" { + return dimValue + } + + return getAgentOriginValue(instanceID, dimValue) } func isContainsInStringArr(target string, array []string) bool { diff --git a/collector/collector_test.go b/collector/collector_test.go index 3c3a8957..ac662c71 100644 --- a/collector/collector_test.go +++ b/collector/collector_test.go @@ -41,11 +41,28 @@ func TestGetLabel(t *testing.T) { } func TestGetDimValue(t *testing.T) { - assert.Equal(t, "0001-0001-0000001", getDimValue("SYS.ECS", "instance_id", "0001-0001-0000001")) - assert.Equal(t, "0001-0001-0000001", getDimValue("AGT.ECS", "instance_id", "0001-0001-0000001")) - assert.Equal(t, "000000000000000", getDimValue("AGT.ECS", "disk", "000000000000000")) + patches := getPatches() + defer patches.Reset() + logs.InitLog("") + sysECSNamespace := "SYS.ECS" + agtECSNamespace := "AGT.ECS" + sysECSMetricData := model.BatchMetricData{ + Namespace: &sysECSNamespace, + Dimensions: &[]model.MetricsDimension{ + {Name: "instance_id", Value: "0001-0001-0000001"}, + }, + } + agtECSMetricData := model.BatchMetricData{ + Namespace: &agtECSNamespace, + Dimensions: &[]model.MetricsDimension{ + {Name: "instance_id", Value: "0001-0001-0000001"}, + }, + } + assert.Equal(t, "0001-0001-0000001", getDimValue(sysECSMetricData, "instance_id", "0001-0001-0000001")) + assert.Equal(t, "0001-0001-0000001", getDimValue(agtECSMetricData, "instance_id", "0001-0001-0000001")) + assert.Equal(t, "000000000000000", getDimValue(agtECSMetricData, "disk", "000000000000000")) agentDimensions.Store("000000000000000", "vda") - assert.Equal(t, "vda", getDimValue("AGT.ECS", "disk", "000000000000000")) + assert.Equal(t, "vda", getDimValue(agtECSMetricData, "disk", "000000000000000")) } func TestTransMetric(t *testing.T) { diff --git a/collector/common.go b/collector/common.go index 4e9c17e0..c4b761cc 100644 --- a/collector/common.go +++ b/collector/common.go @@ -17,8 +17,13 @@ func GetHttpConfig() *config.HttpConfig { Port: global.HttpPort, } if isUserInfoValid() { - proxy.Username = global.UserName - proxy.Password = global.Password + if ProxyEnabled { + proxy.Username = TmpProxyUserName + proxy.Password = TmpProxyPassword + } else { + proxy.Username = global.UserName + proxy.Password = global.Password + } } httpConfig.HttpProxy = &proxy return httpConfig diff --git a/collector/config.go b/collector/config.go index 96dfc117..d6221c7a 100644 --- a/collector/config.go +++ b/collector/config.go @@ -48,6 +48,9 @@ type Global struct { HttpPort int `yaml:"proxy_port"` UserName string `yaml:"proxy_username"` Password string `yaml:"proxy_password"` + + // CN列表,用于校验https证书链中的DNS名称 + ClientCN string `yaml:"client_cn"` } type CloudConfig struct { @@ -57,8 +60,12 @@ type CloudConfig struct { var CloudConf CloudConfig var SecurityMod bool +var HttpsEnabled bool +var ProxyEnabled bool var TmpAK string var TmpSK string +var TmpProxyUserName string +var TmpProxyPassword string func InitCloudConf(file string) error { realPath, err := NormalizePath(file) @@ -149,7 +156,11 @@ var metricConf map[string]MetricConf func InitMetricConf() error { metricConf = make(map[string]MetricConf) - data, err := ioutil.ReadFile(CloudConf.Global.MetricsConfPath) + realPath, err := NormalizePath(CloudConf.Global.MetricsConfPath) + if err != nil { + return err + } + data, err := ioutil.ReadFile(realPath) if err != nil { return err } diff --git a/collector/ecs.go b/collector/ecs.go index 966b5cb0..185e066a 100644 --- a/collector/ecs.go +++ b/collector/ecs.go @@ -40,7 +40,6 @@ func (getter ECSInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInf sysConfigMap := getMetricConfigMap("SYS.ECS") for _, server := range servers { if metricNames, ok := sysConfigMap["instance_id"]; ok { - loadAgentDimensions(server.ID) metrics := buildSingleDimensionMetrics(metricNames, "SYS.ECS", "instance_id", server.ID) filterMetrics = append(filterMetrics, metrics...) info := labelInfo{ diff --git a/collector/ecs_test.go b/collector/ecs_test.go index 7ba2bf1a..ba69bcec 100644 --- a/collector/ecs_test.go +++ b/collector/ecs_test.go @@ -32,7 +32,7 @@ func TestECSInfo_GetResourceInfo(t *testing.T) { IP: "192.168.20.53,100.93.4.203", }, }, nil) - patches.ApplyFunc(loadAgentDimensions, func(instanceID string) {}) + patches.ApplyFunc(loadAgentDimensions, func(instanceID string) error { return nil }) defer patches.Reset() ecsInfo1 := ECSInfo{} _, filterMetrics := ecsInfo1.GetResourceInfo() diff --git a/collector/extensions.go b/collector/extensions.go index a43c965c..9da5d443 100644 --- a/collector/extensions.go +++ b/collector/extensions.go @@ -59,6 +59,7 @@ var ( "SYS.EG": EgInfo{}, "SYS.OBS": OBSInfo{}, "SYS.DNS": DNSInfo{}, + "SYS.EWP": EWPInfo{}, } ) diff --git a/collector/metrics.go b/collector/metrics.go index a241c196..4f5fdce1 100644 --- a/collector/metrics.go +++ b/collector/metrics.go @@ -75,10 +75,17 @@ func getCESClientV2() *cesv2.CesClient { WithEndpoint(getEndpoint("ces", "v2")).Build()) } -func getAgentOriginValue(value string) string { +func getAgentOriginValue(instanceID, value string) string { originValue, ok := agentDimensions.Load(value) if !ok { - return value + err := loadAgentDimensions(instanceID) + if err != nil { + logs.Logger.Errorf("Load agent dimension error: %s", err.Error()) + } + originValue, ok = agentDimensions.Load(value) + if !ok { + return value + } } originV, ok := originValue.(string) @@ -89,22 +96,23 @@ func getAgentOriginValue(value string) string { return originV } -func loadAgentDimensions(instanceID string) { +func loadAgentDimensions(instanceID string) error { dimName := cesv2model.GetListAgentDimensionInfoRequestDimNameEnum() dimNames := []cesv2model.ListAgentDimensionInfoRequestDimName{dimName.DISK, dimName.MOUNT_POINT, dimName.GPU, dimName.PROC, dimName.RAID} for _, name := range dimNames { request := &cesv2model.ListAgentDimensionInfoRequest{ - InstanceId: instanceID, - DimName: name, + InstanceId: instanceID, + DimName: name, } response, err := getCESClientV2().ListAgentDimensionInfo(request) if err != nil { - logs.Logger.Errorf("Failed to list agentDimensions: %s", err.Error()) - return + logs.Logger.Errorf("Failed to list agent dimensions: %s", err.Error()) + return err } for _, dimension := range *response.Dimensions { agentDimensions.Store(*dimension.Value, *dimension.OriginValue) } } + return nil } diff --git a/collector/rms.go b/collector/rms.go index 786f99a2..941933dc 100644 --- a/collector/rms.go +++ b/collector/rms.go @@ -59,6 +59,8 @@ func listResources(provider, resourceType string, optionalRegionID ...string) ([ func getResourcesFromRMS(req *model.ListResourcesRequest) ([]model.ResourceEntity, error) { var resources []model.ResourceEntity + // 多EPID下,保证每个EPID查询开始时,Marker都是初始值 + req.Marker = nil for { response, err := getRMSClient().ListResources(req) if err != nil { diff --git a/collector/utils.go b/collector/utils.go index fd61d7b4..d0390bd5 100644 --- a/collector/utils.go +++ b/collector/utils.go @@ -15,6 +15,7 @@ import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/impl" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdkerr" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" iam "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iam/v3" @@ -300,3 +301,20 @@ func GetIAMClient() *iam.IamClient { WithHttpConfig(GetHttpConfig().WithIgnoreSSLVerification(CloudConf.Global.IgnoreSSLVerify)). Build()) } + +func strSliceContains(ss []string, s string) bool { + for _, v := range ss { + if v == s { + return true + } + } + return false +} + +func isErrorTypeForTooManyRequests(err error) bool { + serviceRespError, ok := err.(*sdkerr.ServiceResponseError) + if ok { + return serviceRespError.StatusCode == TooManyRequestsErrorCode + } + return false +} diff --git a/collector/utils_test.go b/collector/utils_test.go index 0812e6bf..f18aad04 100644 --- a/collector/utils_test.go +++ b/collector/utils_test.go @@ -296,3 +296,35 @@ func TestDimNameEquals(t *testing.T) { sortedDimName = "city" assert.False(t, DimNameEquals(dimName, sortedDimName)) } + +func TestStrSliceContains(t *testing.T) { + testCases := []struct { + name string + str string + slice []string + expect func(t *testing.T, result bool) + }{ + { + "return_true", + "aaa", + []string{"aaa", "bbb"}, + func(t *testing.T, result bool) { + assert.True(t, result) + }, + }, + { + "return_false", + "aaa", + []string{"bbb", "ccc"}, + func(t *testing.T, result bool) { + assert.False(t, result) + }, + }, + } + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + result := strSliceContains(testCase.slice, testCase.str) + testCase.expect(t, result) + }) + } +} diff --git a/collector/version.go b/collector/version.go index 9b083c51..9b7f49d5 100644 --- a/collector/version.go +++ b/collector/version.go @@ -1,5 +1,5 @@ package collector const ( - Version = "v2.0.12" + Version = "v2.0.13" ) diff --git a/collector/waf.go b/collector/waf.go index 6d50e75e..22df4397 100644 --- a/collector/waf.go +++ b/collector/waf.go @@ -80,14 +80,14 @@ func getWAFClient() *waf.WafClient { func getAllPremiumWafInstances() []wafModel.ListInstance { resp, err := getWAFClient().ListInstance(&wafModel.ListInstanceRequest{}) - if resp.HttpStatusCode != http.StatusOK { - logs.Logger.Errorf("Get all premiumWafInstances HttpStatusCode is %d", resp.HttpStatusCode) - return nil - } if err != nil { logs.Logger.Errorf("Get all premiumWafInstances err, err is : %s", err.Error()) return nil } + if resp.HttpStatusCode != http.StatusOK { + logs.Logger.Errorf("Get all premiumWafInstances HttpStatusCode is %d", resp.HttpStatusCode) + return nil + } return *resp.Items } diff --git a/endpoints.yml b/endpoints.yml index 12e635ba..3fccb0fd 100644 --- a/endpoints.yml +++ b/endpoints.yml @@ -1,4 +1,2 @@ -"rms": - "https://rms.xxx.com" -"eps": - "https://eps.xxx.com" \ No newline at end of file +"ewp": + "https://cloudsite-internal.cn-north-4.myhuaweicloud.com" \ No newline at end of file diff --git a/grafana_dashboard/templates/rds_dashboard_template.json b/grafana_dashboard/templates/rds_dashboard_template.json index 0ddbadf2..a8c62e07 100644 --- a/grafana_dashboard/templates/rds_dashboard_template.json +++ b/grafana_dashboard/templates/rds_dashboard_template.json @@ -1,1847 +1,2013 @@ { "__inputs": [ { - "name": "prometheus-cloudeye-exporter", - "label": "prometheus-cloudeye-exporter", - "description": "prometheus plugin that obtains data from cloudeye exporter for grafana", + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", "type": "datasource", "pluginId": "prometheus", - "pluginName": "prometheus" + "pluginName": "Prometheus" } ], - "description": "【华为云RDS监控指标说明】https://support.huaweicloud.com/usermanual-rds/rds_06_0001.html", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 8919, - "graphTooltip": 0, - "id": 25, - "iteration": 1652184667477, - "links": [ + "__elements": {}, + "__requires": [ { - "$$hashKey": "object:2302", - "asDropdown": true, - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "", - "type": "dashboards" + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.4.1" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" } ], - "liveNow": false, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "适配10.x版本", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], "panels": [ { "collapsed": false, - "datasource": "${prometheus-cloudeye-exporter}", "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, - "id": 187, + "id": 2, "panels": [], "repeat": "EPS", + "repeatDirection": "h", "title": "资源总览(企业项目)企业项目:$EPS", "type": "row" }, { - "columns": [], + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "description": "", - "fontSize": "80%", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "CPU使用率" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "percent" + }, + { + "id": "decimals", + "value": 2 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 70 + }, + { + "color": "red", + "value": 85 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "内存使用率" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "percent" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 70 + }, + { + "color": "red", + "value": 85 + } + ] + } + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "磁盘使用率" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "percent" + }, + { + "id": "decimals", + "value": 2 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "red", + "value": 80 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "总连接数" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "none" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 1000 + }, + { + "color": "red", + "value": 1500 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "网络输入吞吐量" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "bps" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 30485760 + }, + { + "color": "red", + "value": 104857600 + } + ] + } + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "网络输出吞吐量" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "unit", + "value": "bps" + }, + { + "id": "decimals", + "value": 2 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 30485760 + }, + { + "color": "red", + "value": 104857600 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "engineName" + }, + "properties": [ + { + "id": "custom.width", + "value": 110 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "主机名" + }, + "properties": [ + { + "id": "custom.width", + "value": 161 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/[^IP,engineName,主机名,内存使用率,总连接数,网络输入吞吐量,CPU使用率,磁盘使用率]/" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 10, "w": 24, "x": 0, "y": 1 }, - "id": 185, - "showHeader": true, - "sort": { - "col": 14, - "desc": true - }, - "styles": [ - { - "$$hashKey": "object:1808", - "alias": "主机名", - "align": "auto", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 1, - "link": false, - "linkTooltip": "", - "linkUrl": "", - "mappingType": 1, - "pattern": "name", - "thresholds": [], - "type": "string", - "unit": "bytes" - }, - { - "$$hashKey": "object:1809", - "alias": "IP(链接到明细)", - "align": "auto", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "link": true, - "linkTargetBlank": false, - "linkTooltip": "浏览主机明细", - "linkUrl": "", - "mappingType": 1, - "pattern": "dataVip", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "$$hashKey": "object:1810", - "alias": "磁盘使用率", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "link": false, - "mappingType": 1, - "pattern": "Value #C", - "thresholds": [], - "type": "number", - "unit": "percent" - }, - { - "$$hashKey": "object:1814", - "alias": "CPU使用率", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #A", - "thresholds": [ - "70", - "85" - ], - "type": "number", - "unit": "percent" - }, - { - "$$hashKey": "object:1815", - "alias": "内存使用率", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #B", - "thresholds": [ - "70", - "85" - ], - "type": "number", - "unit": "percent" - }, - { - "$$hashKey": "object:1818", - "alias": "网络输入吞吐量", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #E", - "thresholds": [ - "30485760", - "104857600" - ], - "type": "number", - "unit": "bps" - }, - { - "$$hashKey": "object:1819", - "alias": "网络输出吞吐量", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #F", - "thresholds": [ - "30485760", - "104857600" - ], - "type": "number", - "unit": "bps" - }, - { - "$$hashKey": "object:1820", - "alias": "5min负载", - "align": "auto", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #L", - "thresholds": [], - "type": "number", - "unit": "short" - }, - { - "$$hashKey": "object:1821", - "alias": "连接数", - "align": "auto", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "Value #D", - "thresholds": [ - "1000", - "1500" - ], - "type": "number", - "unit": "short" - }, - { - "$$hashKey": "object:1822", - "alias": "TCP_tw", - "align": "center", - "colorMode": "cell", - "colors": [ - "rgba(50, 172, 45, 0.97)", - "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" - ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "mappingType": 1, - "pattern": "Value #N", - "thresholds": [ - "5000", - "20000" - ], - "type": "number", - "unit": "short" - }, - { - "$$hashKey": "object:10219", - "alias": "", - "align": "auto", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" + "id": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": false, + "fields": [], + "reducer": [ + "sum" ], - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "decimals": 2, - "mappingType": 1, - "pattern": "engineName", - "thresholds": [], - "type": "string", - "unit": "short" + "show": false }, - { - "$$hashKey": "object:1823", - "alias": "", - "align": "right", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "hidden", - "unit": "short" - } - ], + "frameIndex": 17, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.4.1", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\"} -0", + "expr": "huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\", name=~\"$hostname\"} -0", "format": "table", - "hide": false, "instant": true, - "interval": "", "legendFormat": "CPU使用率", + "range": false, "refId": "A" }, { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "huaweicloud_sys_rds_rds002_mem_util{epId=~\"$EPS\"} -0", + "expr": "huaweicloud_sys_rds_rds002_mem_util{epId=~\"$EPS\", name=~\"$hostname\"} -0", "format": "table", "hide": false, "instant": true, - "interval": "", "legendFormat": "内存使用率", + "range": false, "refId": "B" }, { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "huaweicloud_sys_rds_rds039_disk_util{epId=~\"$EPS\"} - 0", + "expr": "huaweicloud_sys_rds_rds039_disk_util{epId=~\"$EPS\", name=~\"$hostname\"} - 0", "format": "table", "hide": false, "instant": true, - "interval": "", "legendFormat": "磁盘使用率", + "range": false, "refId": "C" }, { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_rds_rds006_conn_count{epId=~'$EPS'}) by (dataVip) - 0", + "expr": "avg(huaweicloud_sys_rds_rds006_conn_count{epId=~'$EPS', name=~\"$hostname\"}) by (dataVip) - 0", "format": "table", "hide": false, "instant": true, - "interval": "", "legendFormat": "总连接数", + "range": false, "refId": "D" }, { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_rds_rds004_bytes_in{epId=~'$EPS'}) by (dataVip) - 0", + "expr": "avg(huaweicloud_sys_rds_rds004_bytes_in{epId=~'$EPS', name=~\"$hostname\"}) by (dataVip) - 0", "format": "table", "hide": false, "instant": true, - "interval": "", "legendFormat": "网络输入吞吐量", + "range": false, "refId": "E" }, { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_rds_rds005_bytes_out{epId=~'$EPS'}) by (dataVip) - 0", + "expr": "avg(huaweicloud_sys_rds_rds005_bytes_out{epId=~'$EPS', name=~\"$hostname\"}) by (dataVip) - 0", "format": "table", "hide": false, "instant": true, - "interval": "", "legendFormat": "网络输出吞吐量", + "range": false, "refId": "F" } ], - "datasource": "${prometheus-cloudeye-exporter}", "title": "RDS资源总览表【企业项目:$EPS,实例总数:$total】", - "transform": "table", - "type": "table-old" + "transformations": [ + { + "id": "joinByField", + "options": { + "byField": "dataVip", + "mode": "outer" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Time 4": true, + "Time 5": true, + "Time 6": true, + "Value #B": false, + "cpu 1": true, + "cpu 2": true, + "cpu 3": true, + "engineName 2": true, + "engineName 3": true, + "engineVersion 1": true, + "engineVersion 2": true, + "engineVersion 3": true, + "epId 1": true, + "epId 2": true, + "epId 3": true, + "instance 1": true, + "instance 2": true, + "instance 3": true, + "job 1": true, + "job 2": true, + "job 3": true, + "mem 1": true, + "mem 2": true, + "mem 3": true, + "name 2": true, + "name 3": true, + "nodeNum 1": true, + "nodeNum 2": true, + "nodeNum 3": true, + "port 1": true, + "port 2": true, + "port 3": true, + "rds_cluster_id 1": true, + "rds_cluster_id 2": true, + "rds_cluster_id 3": true, + "rds_cluster_sqlserver_id 1": false, + "rds_cluster_sqlserver_id 2": false, + "rds_cluster_sqlserver_id 3": false, + "unit 1": true, + "unit 2": true, + "unit 3": true + }, + "includeByName": {}, + "indexByName": { + "Time 1": 3, + "Time 2": 15, + "Time 3": 29, + "Time 4": 43, + "Time 5": 45, + "Time 6": 47, + "Value #A": 14, + "Value #B": 28, + "Value #C": 42, + "Value #D": 44, + "Value #E": 46, + "Value #F": 48, + "cpu 1": 4, + "cpu 2": 16, + "cpu 3": 30, + "dataVip": 0, + "engineName 1": 1, + "engineName 2": 17, + "engineName 3": 31, + "engineVersion 1": 5, + "engineVersion 2": 18, + "engineVersion 3": 32, + "epId 1": 6, + "epId 2": 19, + "epId 3": 33, + "instance 1": 7, + "instance 2": 20, + "instance 3": 34, + "job 1": 8, + "job 2": 21, + "job 3": 35, + "mem 1": 9, + "mem 2": 22, + "mem 3": 36, + "name 1": 2, + "name 2": 23, + "name 3": 37, + "nodeNum 1": 10, + "nodeNum 2": 24, + "nodeNum 3": 38, + "port 1": 11, + "port 2": 25, + "port 3": 39, + "rds_cluster_id 1": 12, + "rds_cluster_id 2": 26, + "rds_cluster_id 3": 40, + "unit 1": 13, + "unit 2": 27, + "unit 3": 41 + }, + "renameByName": { + "Time 1": "", + "Time 3": "", + "Time 4": "", + "Value #A": "CPU使用率", + "Value #B": "内存使用率", + "Value #C": "磁盘使用率", + "Value #D": "总连接数", + "Value #E": "网络输入吞吐量", + "Value #F": "网络输出吞吐量", + "cpu 1": "", + "cpu 3": "", + "dataVip": "IP", + "engineName 1": "", + "mem 1": "", + "name 1": "主机名" + } + } + } + ], + "type": "table" }, { "collapsed": false, - "datasource": "${prometheus-cloudeye-exporter}", "gridPos": { "h": 1, "w": 24, "x": 0, "y": 11 }, - "id": 189, + "id": 3, "panels": [], "repeat": "EPS", + "repeatDirection": "h", "title": "资源明细:【$EPS】【$hostIP】【$hostname】", "type": "row" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 10, + "h": 9, "w": 12, "x": 0, "y": 12 }, - "hiddenSeries": false, - "id": 7, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 4, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "/.*总使用率/", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds001_cpu_util{dataVip=~\"$hostIP\"}", - "format": "time_series", - "hide": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds001_cpu_util{dataVip=~\"$hostIP\", name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-CPU使用率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "CPU使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "percent", - "label": "", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_总内存": "dark-red", - "使用率": "yellow", - "内存_Avaliable": "#6ED0E0", - "内存_Cached": "#EF843C", - "内存_Free": "#629E51", - "内存_Total": "#6d1f62", - "内存_Used": "#eab839", - "可用": "#9ac48a", - "总内存": "#bf1b00" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, + "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 10, + "h": 9, "w": 12, "x": 12, "y": 12 }, - "height": "300", - "hiddenSeries": false, - "id": 156, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 5, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:154", - "alias": "使用率", - "color": "rgb(0, 209, 255)", - "lines": false, - "pointradius": 1, - "points": true, - "yaxis": 2 + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds002_mem_util{dataVip=~\"$hostIP\"}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds002_mem_util{dataVip=~\"$hostIP\", name=~\"$hostname\"}", "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})内存使用率", - "refId": "A", - "step": 4 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "内存使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:183", - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:184", - "format": "percent", - "label": "", - "logBase": 1, - "max": "100", - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "15分钟": "#6ED0E0", - "1分钟": "#BF1B00", - "5分钟": "#CCA300" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "QPS:该指标用于统计SQL语句查询次数,含存储过程,以次/秒为单位。\nTPS:该指标用于统计事务执行次数,含提交的和回退的,以次/秒为单位。", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, - "grid": {}, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 0, - "y": 22 - }, - "height": "300", - "hiddenSeries": false, - "id": 13, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 21 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null as zero", + "id": 6, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:129", - "alias": "/.*总核数/", - "color": "#C4162A" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds008_qps{dataVip=~\"$hostIP\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds008_qps{dataVip=~\"$hostIP\", name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-QPS", - "metric": "", - "refId": "A", - "step": 20, - "target": "" + "range": true, + "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds009_tps{dataVip=~\"$hostIP\"}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds009_tps{dataVip=~\"$hostIP\", name=~\"$hostname\"}", "hide": false, - "interval": "", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-TPS", + "range": true, "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "QPS+TPS", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 2, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:136", - "format": "none", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:137", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 1, - "description": "", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 12, - "y": 22 - }, - "hiddenSeries": false, - "id": 174, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 21 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 7, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:220", - "alias": "/Inodes.*/", - "yaxis": 2 + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds039_disk_util{dataVip=~\"$hostIP\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds039_disk_util{dataVip=~\"$hostIP\", name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-磁盘使用率(/)", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:227", - "format": "percent", - "label": "", - "logBase": 1, - "max": "100", - "min": "0", - "show": true - }, - { - "$$hashKey": "object:228", - "decimals": 2, - "format": "percentunit", - "logBase": 1, - "max": "1", - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 0, - "y": 32 - }, - "hiddenSeries": false, - "id": 175, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": true + "y": 29 }, - "lines": true, - "linewidth": 1, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 8, "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", "targets": [ { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "exemplar": true, - "expr": "huaweicloud_sys_rds_rds081_vm_ioutils{dataVip=~'$hostIP'}", - "format": "time_series", - "interval": "", - "intervalFactor": 1, + "expr": "huaweicloud_sys_rds_rds081_vm_ioutils{dataVip=~'$hostIP', name=~\"$hostname\"}", + "instant": false, "legendFormat": " {{dataVip}}({{name}})-磁盘I/O使用率(/)", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘I/O使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:997", - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:998", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "vda_write": "#6ED0E0" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "iops" }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 12, - "y": 32 - }, - "height": "300", - "hiddenSeries": false, - "id": 161, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 29 }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", + "id": 9, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:545", - "alias": "", - "transform": "negative-Y" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds003_iops{dataVip=~'$hostIP'}", - "format": "time_series", - "hide": false, - "interval": "", - "intervalFactor": 1, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds003_iops{dataVip=~'$hostIP', name=~\"$hostname\"}", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-磁盘读IOPS", - "refId": "A", - "step": 10 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘读写速率(IOPS)", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:566", - "format": "iops", - "label": "", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:567", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "vda_write": "#6ED0E0" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "Read bytes 每个磁盘分区每秒读取的比特数\nWritten bytes 每个磁盘分区每秒写入的比特数", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "读取(-)/写入(+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 0, - "y": 42 - }, - "height": "300", - "hiddenSeries": false, - "id": 168, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 37 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 10, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:4199", - "alias": "/.*_读取$/", - "transform": "negative-Y" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds049_disk_read_throughput{dataVip=~'$hostIP'}", - "format": "time_series", - "interval": "", - "intervalFactor": 1, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds049_disk_read_throughput{dataVip=~'$hostIP', name=~\"$hostname\"}", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-磁盘读吞吐量", - "refId": "A", - "step": 10 + "range": true, + "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds050_disk_write_throughput{dataVip=~'$hostIP'}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds050_disk_write_throughput{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, - "interval": "", - "intervalFactor": 1, + "instant": false, "legendFormat": "{{dataVip}}({{name}})-磁盘写吞吐量", - "refId": "B", - "step": 10 + "range": true, + "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘读写吞吐量", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:137", - "format": "Bps", - "label": "读取(-)/写入(+)", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:138", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "vda": "#6ED0E0" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 12, - "y": 42 - }, - "height": "300", - "hiddenSeries": false, - "id": 160, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 37 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null as zero", + "id": 11, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:3772", - "alias": "/,*_读取$/", - "transform": "negative-Y" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds075_avg_disk_ms_per_read{dataVip=~'$hostIP'}", - "format": "time_series", - "hide": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds075_avg_disk_ms_per_read{dataVip=~'$hostIP', name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-磁盘读耗时", + "range": true, "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds076_avg_disk_ms_per_write{dataVip=~'$hostIP'}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds076_avg_disk_ms_per_write{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-磁盘写耗时", + "range": true, "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘读写耗时", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:316", - "format": "ms", - "label": "", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:317", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "vda_write": "#6ED0E0" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 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": "s" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 0, - "y": 52 + "y": 45 }, - "height": "300", - "hiddenSeries": false, - "id": 190, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 12, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:4199", - "alias": "/.*_读取$/", - "transform": "negative-Y" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds073_replication_delay{dataVip=~'$hostIP'}", - "format": "time_series", - "interval": "", - "intervalFactor": 1, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds073_replication_delay{dataVip=~'$hostIP', name=~\"$hostname\"}", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-实时复制时延", - "refId": "A", - "step": 10 + "range": true, + "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds173_replication_delay_avg{dataVip=~'$hostIP'}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds173_replication_delay_avg{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, - "interval": "", - "intervalFactor": 1, + "instant": false, "legendFormat": "{{dataVip}}({{name}})-平均复制时延", - "refId": "B", - "step": 10 + "range": true, + "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "复制时延(平均+实时)", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:137", - "format": "s", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:138", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "vda_write": "#6ED0E0" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "读取(-)/写入(+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, "gridPos": { - "h": 10, + "h": 8, "w": 12, "x": 12, - "y": 52 + "y": 45 }, - "height": "300", - "hiddenSeries": false, - "id": 191, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 13, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:4199", - "alias": "", - "transform": "negative-Y" + "legend": { + "calcs": [ + "min", + "max", + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, - "expr": "0 - huaweicloud_sys_rds_rds049_disk_read_throughput{dataVip=~'$hostIP'}", - "format": "time_series", - "interval": "", - "intervalFactor": 1, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "0 - huaweicloud_sys_rds_rds049_disk_read_throughput{dataVip=~'$hostIP', name=~\"$hostname\"}", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-磁盘读吞吐量", - "refId": "A", - "step": 10 + "range": true, + "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds050_disk_write_throughput{dataVip=~'$hostIP'}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds050_disk_write_throughput{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, - "interval": "", - "intervalFactor": 1, + "instant": false, "legendFormat": "{{dataVip}}({{name}})-磁盘写吞吐量", - "refId": "B", - "step": 10 + "range": true, + "refId": "B" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘读写吞吐量", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:137", - "format": "Bps", - "label": "读取(-)/写入(+)", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:138", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_TCP_alloc": "semi-dark-blue", - "TCP": "#6ED0E0", - "TCP_alloc": "blue" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 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": "none" }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 8, + "h": 9, "w": 24, "x": 0, - "y": 62 + "y": 53 }, - "height": "300", - "hiddenSeries": false, - "id": 158, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", + "id": 14, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:4470", - "alias": "/.*Sockets_used/", - "color": "#E02F44", - "lines": false, - "pointradius": 1, - "points": true, - "yaxis": 2 + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds074_slow_queries{dataVip=~'$hostIP'}", - "format": "time_series", - "hide": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds074_slow_queries{dataVip=~'$hostIP', name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-慢日志个数统计", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "慢日志个数统计", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "transformations": [], - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:4485", - "format": "none", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:4486", - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_TCP_alloc": "semi-dark-blue", - "TCP": "#6ED0E0", - "TCP_alloc": "blue" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, - "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 8, + "h": 12, "w": 24, "x": 0, - "y": 70 - }, - "height": "300", - "hiddenSeries": false, - "id": 192, - "interval": "", - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true + "y": 62 }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", + "id": 15, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.5", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:4470", - "alias": "/.*Sockets_used/", - "color": "#E02F44", - "lines": false, - "pointradius": 1, - "points": true, - "yaxis": 2 + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds006_conn_count{dataVip=~'$hostIP'}", - "format": "time_series", - "hide": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds006_conn_count{dataVip=~'$hostIP', name=~\"$hostname\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{dataVip}}({{name}})-数据库总连接数", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds007_conn_active_count{dataVip=~'$hostIP'}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds007_conn_active_count{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, "instant": false, - "interval": "", "legendFormat": "{{dataVip}}({{name}})-当前活跃连接数", + "range": true, "refId": "B" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds072_conn_usage{dataVip=~'$hostIP'}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds072_conn_usage{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, "instant": false, - "interval": "", "legendFormat": "{{dataVip}}({{name}})-连接数使用率", + "range": true, "refId": "C" }, { - "exemplar": true, - "expr": "huaweicloud_sys_rds_rds_conn_active_usage{dataVip=~'$hostIP'}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_rds_rds_conn_active_usage{dataVip=~'$hostIP', name=~\"$hostname\"}", "hide": false, - "interval": "", + "instant": false, "legendFormat": "{{dataVip}}({{name}})-活跃连接数使用率", + "range": true, "refId": "D" } ], - "thresholds": [], - "timeRegions": [], "title": "网络连接信息", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "transformations": [], - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:4485", - "format": "short", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:4486", - "format": "percent", - "label": "连接数使用率", - "logBase": 1, - "min": "0", - "show": true - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" } ], - "refresh": "", - "schemaVersion": 34, - "style": "dark", - "tags": [ - "Prometheus" - ], + "schemaVersion": 39, + "tags": [], "templating": { "list": [ { - "current": { - "selected": true, - "text": "default", - "value": "0" + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "datasource": "${prometheus-cloudeye-exporter}", "definition": "huaweicloud_epinfo", "hide": 0, "includeAll": false, @@ -1850,8 +2016,9 @@ "name": "EPS", "options": [], "query": { + "qryType": 4, "query": "huaweicloud_epinfo", - "refId": "StandardVariableQuery" + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "/epName=\"(?[^\"]+)|epId=\"(?[^\"]+)/g", @@ -1860,17 +2027,12 @@ "type": "query" }, { - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "datasource": "${prometheus-cloudeye-exporter}", - "definition": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\"},dataVip)", + "definition": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=\"$EPS\"},dataVip)", "hide": 0, "includeAll": true, "label": "RDS-IP", @@ -1878,8 +2040,9 @@ "name": "hostIP", "options": [], "query": { - "query": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\"},dataVip)", - "refId": "StandardVariableQuery" + "qryType": 1, + "query": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=\"$EPS\"},dataVip)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", @@ -1888,13 +2051,12 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "All", - "value": "$__all" + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "datasource": "${prometheus-cloudeye-exporter}", - "definition": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\",dataVip=~\"$hostIP\"},name)", + "definition": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=\"$EPS\"},name)", "hide": 0, "includeAll": true, "label": "实例名", @@ -1902,8 +2064,9 @@ "name": "hostname", "options": [], "query": { - "query": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\",dataVip=~\"$hostIP\"},name)", - "refId": "StandardVariableQuery" + "qryType": 1, + "query": "label_values(huaweicloud_sys_rds_rds001_cpu_util{epId=\"$EPS\"},name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", @@ -1912,22 +2075,21 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "13", - "value": "13" + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "datasource": "${prometheus-cloudeye-exporter}", "definition": "query_result(count(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\"}))", "hide": 2, "includeAll": false, - "label": "", "multi": false, "name": "total", "options": [], "query": { + "qryType": 3, "query": "query_result(count(huaweicloud_sys_rds_rds001_cpu_util{epId=~\"$EPS\"}))", - "refId": "StandardVariableQuery" + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "/{} (.*) .*/", @@ -1941,32 +2103,10 @@ "from": "now-1h", "to": "now" }, - "timepicker": { - "hidden": false, - "now": true, - "refresh_intervals": [ - "15s", - "30s", - "1m", - "5m", - "15m", - "30m" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, + "timepicker": {}, "timezone": "browser", "title": "关系型数据库(RDS)", - "uid": "9CWBz0bi4", - "version": 14, + "uid": "cdyyfytqtixogf", + "version": 3, "weekStart": "" } \ No newline at end of file diff --git a/grafana_dashboard/templates/vpc_dashboard_template.json b/grafana_dashboard/templates/vpc_dashboard_template.json index 4fd28f5b..6e7899ea 100644 --- a/grafana_dashboard/templates/vpc_dashboard_template.json +++ b/grafana_dashboard/templates/vpc_dashboard_template.json @@ -2,7 +2,7 @@ "__inputs": [ { "name": "DS_PROMETHEUS", - "label": "Prometheus", + "label": "prometheus", "description": "", "type": "datasource", "pluginId": "prometheus", @@ -15,7 +15,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "10.2.0" + "version": "10.4.1" }, { "type": "datasource", @@ -76,7 +76,10 @@ "type": "row" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -358,6 +361,18 @@ } } ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/[^带宽类型,带宽ID,计费模式,带宽名称,入网带宽,入网带宽使用率,入网流量,出网带宽,出网带宽使用率,出网流量]/" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] } ] }, @@ -381,10 +396,13 @@ }, "showHeader": true }, - "pluginVersion": "10.2.0", + "pluginVersion": "10.4.1", "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_downstream_bandwidth{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -395,7 +413,10 @@ "refId": "A" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_downstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -407,7 +428,10 @@ "refId": "B" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_down_stream{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -419,7 +443,10 @@ "refId": "C" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_upstream_bandwidth{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -431,7 +458,10 @@ "refId": "D" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_upstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -443,7 +473,10 @@ "refId": "E" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, "expr": "huaweicloud_sys_vpc_up_stream{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", @@ -484,6 +517,7 @@ "id": "organize", "options": { "excludeByName": {}, + "includeByName": {}, "indexByName": {}, "renameByName": { "Value #A": "入网带宽", @@ -518,7 +552,10 @@ "type": "row" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -600,7 +637,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_downstream_bandwidth{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -613,7 +653,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -695,7 +738,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_downstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -708,7 +754,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -790,7 +839,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_down_stream{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -803,7 +855,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -885,7 +940,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_upstream_bandwidth{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -898,7 +956,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -980,7 +1041,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_upstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -993,7 +1057,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1075,7 +1142,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_up_stream{epId=~\"$EPS\",publicIpAddress=~\"\", chargeMode=~\"$ChargeMode\"}", "instant": false, @@ -1103,7 +1173,10 @@ "type": "row" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1400,6 +1473,18 @@ ] } ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/[^IP,计费模式,弹性公网IP ID,入网带宽,入网使用率,入网流量,出网带宽,出网使用率,出网流量]/" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] } ] }, @@ -1428,13 +1513,16 @@ } ] }, - "pluginVersion": "10.2.0", + "pluginVersion": "10.4.1", "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_downstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_downstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1442,10 +1530,13 @@ "refId": "A" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_downstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_downstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "hide": false, "instant": true, @@ -1454,10 +1545,13 @@ "refId": "B" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_down_stream{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_down_stream{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "hide": false, "instant": true, @@ -1466,10 +1560,13 @@ "refId": "C" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_upstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_upstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "hide": false, "instant": true, @@ -1478,10 +1575,13 @@ "refId": "D" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_upstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_upstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "hide": false, "instant": true, @@ -1490,10 +1590,13 @@ "refId": "E" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "exemplar": false, - "expr": "avg(huaweicloud_sys_vpc_up_stream{epId=~\"$EPS\",publicIpAddress!=\"\"}) by (name,publicip_id,bandwidthChargeMode)", + "expr": "avg(huaweicloud_sys_vpc_up_stream{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}) by (name,publicip_id,bandwidthChargeMode)", "format": "table", "hide": false, "instant": true, @@ -1530,6 +1633,7 @@ "id": "organize", "options": { "excludeByName": {}, + "includeByName": {}, "indexByName": { "Value #A": 3, "Value #B": 4, @@ -1573,7 +1677,10 @@ "type": "row" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1655,7 +1762,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_downstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -1668,7 +1778,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1750,7 +1863,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_downstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\",bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -1763,7 +1879,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1845,7 +1964,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_down_stream{epId=~\"$EPS\",publicIpAddress!=\"\",bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -1858,7 +1980,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -1940,7 +2065,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_upstream_bandwidth{epId=~\"$EPS\",publicIpAddress!=\"\", bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -1953,7 +2081,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -2035,7 +2166,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_upstream_bandwidth_usage{epId=~\"$EPS\",publicIpAddress!=\"\",bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -2048,7 +2182,10 @@ "type": "timeseries" }, { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "fieldConfig": { "defaults": { "color": { @@ -2130,7 +2267,10 @@ }, "targets": [ { - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "editorMode": "code", "expr": "huaweicloud_sys_vpc_up_stream{epId=~\"$EPS\",publicIpAddress!=\"\",bandwidthChargeMode=~\"$ChargeMode\"}", "instant": false, @@ -2144,13 +2284,16 @@ } ], "refresh": "", - "schemaVersion": 38, + "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": {}, - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "definition": "huaweicloud_epinfo", "hide": 0, "includeAll": false, @@ -2173,10 +2316,10 @@ "current": { "selected": true, "text": [ - "按带宽" + "按流量" ], "value": [ - "bandwidth" + "traffic" ] }, "hide": 0, @@ -2191,12 +2334,12 @@ "value": "$__all" }, { - "selected": true, + "selected": false, "text": "按带宽", "value": "bandwidth" }, { - "selected": false, + "selected": true, "text": "按流量", "value": "traffic" } @@ -2209,13 +2352,13 @@ ] }, "time": { - "from": "now-3h", + "from": "now-1h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "弹性公网IP和带宽(VPC)", "uid": "dfa72048-c799-4fdc-adfa-36b472b981a5", - "version": 3, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/grafana_dashboard/templates/waf_dashboard_template.json b/grafana_dashboard/templates/waf_dashboard_template.json index 24c741b3..cdcd2571 100644 --- a/grafana_dashboard/templates/waf_dashboard_template.json +++ b/grafana_dashboard/templates/waf_dashboard_template.json @@ -1,1250 +1,1068 @@ { "__inputs": [ { - "name": "prometheus-cloudeye-exporter", - "label": "prometheus-cloudeye-exporter", - "description": "prometheus plugin that obtains data from cloudeye exporter for grafana", + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", "type": "datasource", "pluginId": "prometheus", - "pluginName": "prometheus" + "pluginName": "Prometheus" } ], - "description": "【华为云WAF监控指标说明】https://support.huaweicloud.com/usermanual-waf/waf_01_0372.html", - "editable": true, - "gnetId": 8919, - "graphTooltip": 0, - "id": 5, - "iteration": 1659320408090, - "links": [ + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.4.1" + }, { - "$$hashKey": "object:2302", - "asDropdown": true, - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "", - "type": "dashboards" + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" } ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "【华为云WAF监控指标说明】https://support.huaweicloud.com/usermanual-waf/waf_01_0372.html", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], "panels": [ { - "collapsed": false, - "datasource": "${prometheus-cloudeye-exporter}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 189, - "panels": [], - "repeat": "EPS", - "title": "资源明细:【$waf_name】", - "type": "row" - }, - { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "stepBefore", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 9, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 7, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 1, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_requests{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-请求量", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "请求量", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "reqps", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "15分钟": "#6ED0E0", - "1分钟": "#BF1B00", - "5分钟": "#CCA300" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "", - "editable": true, - "error": false, "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "入网总流量(+)/出网总流量(-)", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mbytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 1, - "grid": {}, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 8, - "y": 1 - }, - "height": "300", - "hiddenSeries": false, - "id": 13, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null as zero", + "id": 2, "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_inbound_traffic{name=~\"$waf_name\"}", - "format": "time_series", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-入网总流量(5min)", - "metric": "", - "refId": "A", - "step": 20, - "target": "" + "range": true, + "refId": "A" }, { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "0 - huaweicloud_sys_waf_outbound_traffic{name=~\"$waf_name\"}", - "format": "time_series", "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-出网总流量(5min)", - "metric": "", - "refId": "B", - "step": 20, - "target": "" + "range": true, + "refId": "B" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "入网总流量/出网总流量(5min)", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 2, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:136", - "format": "mbytes", - "label": "入网总流量(+)/出网总流量(-)", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:137", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 1, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "入网总流量(+)/出网总流量(-)", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "MiBs" }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 16, - "y": 1 - }, - "hiddenSeries": false, - "id": 174, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "min", - "sortDesc": false, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 3, "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { - "exemplar": true, - "expr": "huaweicloud_sys_waf_inbound_traffic_peak{waf_instance_id=~\"$waf_instance_id\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_waf_inbound_traffic_peak{name=~\"$waf_name\"}", "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-入网流量的峰值(5min)", + "range": true, "refId": "A" }, { - "exemplar": true, - "expr": "0 - huaweicloud_sys_waf_outbound_traffic_peak{waf_instance_id=~\"$waf_instance_id\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "0 - huaweicloud_sys_waf_outbound_traffic_peak{name=~\"$waf_name\"}", "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-出网流量的峰值(5min)", + "range": true, "refId": "B" }, { - "exemplar": true, - "expr": "huaweicloud_sys_waf_inbound_traffic_mean{waf_instance_id=~\"$waf_instance_id\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "huaweicloud_sys_waf_inbound_traffic_mean{name=~\"$waf_name\"}", "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-入网流量的均值(5min)", + "range": true, "refId": "C" }, { - "exemplar": true, - "expr": "0 - huaweicloud_sys_waf_outbound_traffic_mean{waf_instance_id=~\"$waf_instance_id\"}", - "format": "time_series", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "0 - huaweicloud_sys_waf_outbound_traffic_mean{name=~\"$waf_name\"}", "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-出网流量的均值(5min)", + "range": true, "refId": "D" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "入网流量/出网流量(均值+峰值)", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:227", - "format": "Mibits", - "label": "入网流量(+)/出网流量(-)", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:228", - "decimals": 2, - "format": "percentunit", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, - "y": 10 + "y": 8 }, - "hiddenSeries": false, - "id": 190, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 4, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_waf_http_2xx{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-WAF返回码(2XX)", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "WAF返回码2XX", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, - "y": 10 + "y": 8 }, - "hiddenSeries": false, - "id": 194, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 5, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "datasource": "${prometheus-cloudeye-exporter}", + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_waf_http_3xx{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-WAF返回码(3XX)", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "WAF返回码3XX", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, - "y": 10 - }, - "hiddenSeries": false, - "id": 195, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 8 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 6, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "/.*总使用率/", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_waf_http_4xx{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-WAF返回码(4XX)", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "WAF返回码4XX", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "none", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 0, - "y": 18 - }, - "hiddenSeries": false, - "id": 196, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 16 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 7, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_waf_http_5xx{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-WAF返回码(5XX)", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "WAF返回码5XX", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_总内存": "dark-red", - "使用率": "yellow", - "内存_Avaliable": "#6ED0E0", - "内存_Cached": "#EF843C", - "内存_Free": "#629E51", - "内存_Total": "#6d1f62", - "内存_Used": "#eab839", - "可用": "#9ac48a", - "总内存": "#bf1b00" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, + "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 8, - "y": 18 - }, - "height": "300", - "hiddenSeries": false, - "id": 197, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 16 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 8, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:154", - "alias": "使用率", - "color": "rgb(0, 209, 255)", - "lines": false, - "pointradius": 1, - "points": true, - "yaxis": 2 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_qps_peak{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-QPS峰值", - "refId": "A", - "step": 4 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "QPS峰值", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:183", - "format": "none", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:184", - "format": "percent", - "label": "", - "logBase": 1, - "max": "100", - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_总内存": "dark-red", - "使用率": "yellow", - "内存_Avaliable": "#6ED0E0", - "内存_Cached": "#EF843C", - "内存_Free": "#629E51", - "内存_Total": "#6d1f62", - "内存_Used": "#eab839", - "可用": "#9ac48a", - "总内存": "#bf1b00" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${prometheus-cloudeye-exporter}", - "decimals": 2, + "description": "", "fieldConfig": { "defaults": { - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "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": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 8, "x": 16, - "y": 18 - }, - "height": "300", - "hiddenSeries": false, - "id": 156, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 16 }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", + "id": 9, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.5.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:154", - "alias": "使用率", - "color": "rgb(0, 209, 255)", - "lines": false, - "pointradius": 1, - "points": true, - "yaxis": 2 + "legend": { + "calcs": [ + "max", + "min", + "lastNotNull", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { - "exemplar": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", "expr": "huaweicloud_sys_waf_qps_mean{name=~\"$waf_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-QPS均值", - "refId": "A", - "step": 4 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "QPS均值", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:183", - "format": "none", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:184", - "format": "percent", - "label": "", - "logBase": 1, - "max": "100", - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" } ], - "refresh": false, - "schemaVersion": 27, - "style": "dark", - "tags": [ - "Prometheus" - ], + "refresh": "", + "schemaVersion": 39, + "tags": [], "templating": { "list": [ { - "allValue": null, - "current": { - "selected": false, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "datasource": "${prometheus-cloudeye-exporter}", - "definition": "label_values(huaweicloud_sys_waf_requests{},name)", - "description": null, - "error": null, + "definition": "label_values(huaweicloud_sys_waf_requests,name)", "hide": 0, "includeAll": true, "label": "防护域名", @@ -1252,50 +1070,26 @@ "name": "waf_name", "options": [], "query": { - "query": "label_values(huaweicloud_sys_waf_requests{},name)", - "refId": "StandardVariableQuery" + "qryType": 1, + "query": "label_values(huaweicloud_sys_waf_requests,name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, - "sort": 5, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 0, + "type": "query" } ] }, "time": { - "from": "now-5m", + "from": "now-30m", "to": "now" }, - "timepicker": { - "hidden": false, - "now": true, - "refresh_intervals": [ - "15s", - "30s", - "1m", - "5m", - "15m", - "30m" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, + "timepicker": {}, "timezone": "browser", "title": "Web应用防火墙(WAF)", - "uid": "9CWBz0bc3", - "version": 4 + "uid": "ae1smk6xg0rnke", + "version": 6, + "weekStart": "" } \ No newline at end of file diff --git a/grafana_dashboard/templates/waf_premium_instance_dashboard_template.json b/grafana_dashboard/templates/waf_premium_instance_dashboard_template.json index 260aa67d..5a1e99b6 100644 --- a/grafana_dashboard/templates/waf_premium_instance_dashboard_template.json +++ b/grafana_dashboard/templates/waf_premium_instance_dashboard_template.json @@ -1,50 +1,47 @@ { "__inputs": [ { - "name": "DS_PROMETHEUS-1", - "label": "Prometheus-1", + "name": "DS_PROMETHEUS", + "label": "prometheus", "description": "", "type": "datasource", "pluginId": "prometheus", "pluginName": "Prometheus" } ], - "__elements": [], + "__elements": {}, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "8.3.3" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph (old)", - "version": "" + "version": "10.4.1" }, { "type": "datasource", "id": "prometheus", "name": "Prometheus", "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" } ], "annotations": { "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "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" } ] @@ -52,1278 +49,996 @@ "description": "【华为云WAF监控指标说明】https://support.huaweicloud.com/usermanual-waf/waf_01_0372.html", "editable": true, "fiscalYearStartMonth": 0, - "gnetId": 8919, "graphTooltip": 0, "id": null, - "iteration": 1709112686397, - "links": [ - { - "$$hashKey": "object:2302", - "asDropdown": true, - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "", - "type": "dashboards" - } - ], - "liveNow": false, + "links": [], "panels": [ { - "collapsed": false, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 189, - "panels": [], - "repeat": "EPS", - "title": "资源明细:【$instance_name】", - "type": "row" - }, - { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, - "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 198, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 1, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_cpu_util{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-CPU使用率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "CPU使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 8, - "y": 1 - }, - "hiddenSeries": false, - "id": 203, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 2, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_mem_util{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-内存使用率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "内存使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "percent" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 16, - "y": 1 - }, - "hiddenSeries": false, - "id": 202, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 0 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 3, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_disk_util{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-磁盘使用率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘使用率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "percent", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], - "unit": "count" + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 0, - "y": 10 + "y": 8 }, - "hiddenSeries": false, - "id": 7, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 4, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_active_connections{unit=\"Count\",name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-活跃连接数", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "活跃连接数", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "count", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Bps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 8, - "y": 10 - }, - "hiddenSeries": false, - "id": 206, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 8 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 5, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_network_incoming_bytes_rate{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-网络流入速率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "网络流入速率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "Bps", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "Bps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 16, - "y": 10 - }, - "hiddenSeries": false, - "id": 200, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 8 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 6, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_network_outgoing_bytes_rate{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-网络流出速率", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "网络流出速率", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "Bps", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], - "unit": "count" + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 0, - "y": 19 - }, - "hiddenSeries": false, - "id": 204, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 16 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 7, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_concurrent_connections{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-并发连接数", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "并发连接数", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "count", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "ms" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 8, - "y": 19 + "y": 16 }, - "hiddenSeries": false, - "id": 205, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 8, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_latest_policy_sync_time{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-最近一次策略同步的耗时", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "最近一次策略同步的耗时", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "ms", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": { - "192.168.200.241:9100_Total": "dark-red", - "Idle - Waiting for something to happen": "#052B51", - "guest": "#9AC48A", - "idle": "#052B51", - "iowait": "#EAB839", - "irq": "#BF1B00", - "nice": "#C15C17", - "sdb_每秒I/O操作%": "#d683ce", - "softirq": "#E24D42", - "steal": "#FCE2DE", - "system": "#508642", - "user": "#5195CE", - "磁盘花费在I/O操作占比": "#ba43a9" + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "bars": false, - "dashLength": 10, - "dashes": false, - "decimals": 2, "description": "", "fieldConfig": { "defaults": { - "links": [], + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 5, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "decbytes" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 9, + "h": 8, "w": 8, "x": 16, - "y": 19 - }, - "hiddenSeries": false, - "id": 201, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true + "y": 16 }, - "lines": true, - "linewidth": 2, - "links": [], - "maxPerRow": 6, - "nullPointMode": "null", + "id": 9, "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "8.3.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:1605", - "alias": "", - "color": "#C4162A", - "fill": 0 + "legend": { + "calcs": [ + "lastNotNull", + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "exemplar": true, + "editorMode": "code", "expr": "huaweicloud_sys_waf_disk_avail_size{name=~\"$instance_name\"}", - "format": "time_series", - "hide": false, "instant": false, - "interval": "", - "intervalFactor": 1, "legendFormat": "{{name}}-磁盘可用空间", - "refId": "A", - "step": 20 + "range": true, + "refId": "A" } ], - "thresholds": [], - "timeRegions": [], "title": "磁盘可用空间", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:11294", - "decimals": 0, - "format": "decbytes", - "label": "", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:11295", - "format": "short", - "logBase": 1, - "show": false - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" } ], - "refresh": false, - "schemaVersion": 34, - "style": "dark", - "tags": [ - "Prometheus" - ], + "schemaVersion": 39, + "tags": [], "templating": { "list": [ { "current": {}, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-1}" + "uid": "${DS_PROMETHEUS}" }, - "definition": "label_values(huaweicloud_sys_waf_active_connections{},name)", + "definition": "label_values(huaweicloud_sys_waf_cpu_util,name)", "hide": 0, - "includeAll": true, + "includeAll": false, "label": "独享引擎实例名称", "multi": true, "name": "instance_name", "options": [], "query": { - "query": "label_values(huaweicloud_sys_waf_active_connections{},name)", - "refId": "StandardVariableQuery" + "qryType": 1, + "query": "label_values(huaweicloud_sys_waf_cpu_util,name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, - "sort": 5, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 0, + "type": "query" } ] }, "time": { - "from": "2024-02-28T09:12:32.328Z", - "to": "2024-02-28T09:22:32.328Z" - }, - "timepicker": { - "hidden": false, - "now": true, - "refresh_intervals": [ - "15s", - "30s", - "1m", - "5m", - "15m", - "30m" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] + "from": "now-15m", + "to": "now" }, + "timepicker": {}, "timezone": "browser", "title": "Web应用防火墙(WAF)-独享实例引擎监控看板", - "uid": "9CWBz0bc4", - "version": 6, + "uid": "ce193biltj1moe", + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/grafana_dashboard/use_grafana_template.md b/grafana_dashboard/use_grafana_template.md index 5da02474..4d229970 100644 --- a/grafana_dashboard/use_grafana_template.md +++ b/grafana_dashboard/use_grafana_template.md @@ -24,6 +24,11 @@ scrape_configs: # 如果开启了企业项目,则配置该任务获取企业项目信息,用于模板 - job_name: 'huaweicloud-eps' + scheme: https # 默认该值为http,代表prometheus以http方式调用cloudeye-exporter,如需以https方式调用,请配置值改为https + tls_config: # prometheus以https调用cloudeye-exporter服务时,该参数必配 + ca_file: root.crt # 客户端CA证书的路径 + cert_file: client.crt # 客户端https证书的路径 + key_file: client.key # 客户端私钥的路径 metrics_path: "/eps-info" static_configs: - targets: ['192.168.0.xx:8087'] @@ -32,15 +37,19 @@ >> ![import.png](pic/import.jpg) >> ![img.png](pic/load.jpg) - 模板文件获取地址: + **当前模板文件基于grafana10.x版本配置,10.x之前版本不再兼容适配,老版模板可使用grafana_dashboard/templates/old_version目录下取用。** + + **如遇grafana模板不兼容问题请升级grafana版本至10.x以上** + + **模板文件获取地址如下:** + [云搜索服务 CSS](templates/css(es)_dashboard_template.json) + [云专线 DCAAS](templates/dcaas_dashboard_template.json) + [分布式缓存服务 DCS](templates/dcs_dashboard_template.json) + [弹性云服务器 ECS](templates/ecs_dashboard_template.json) + [弹性负载均衡 ELB](templates/elb_dashboard_template.json) + [关系型数据库 RDS](templates/rds_dashboard_template.json) - + [Web应用防火墙 WAF](templates/waf_dashboard_template.json) - + [Web应用防火墙 WAF-独享引擎实例](templates/waf_premium_instance_dashboard_template.json) + + [Web应用防火墙 WAF](templates/old_version/waf_dashboard_template.json) + + [Web应用防火墙 WAF-独享引擎实例](templates/old_version/waf_premium_instance_dashboard_template.json) + [弹性公网IP和带宽 VPC](templates/vpc_dashboard_template.json) + [云防火墙 CFW](templates/cfw_dashboard_template.json) + [分布式消息服务 DMS-kafka](templates/dms(Kafka)_dashboard_template.json) @@ -70,6 +79,7 @@ + [事件网格 EG](templates/eg_dashboard_template.json) + [对象存储服务 OBS](templates/obs_dashboard_template.json) + [云解析服务 DNS](templates/dns_dashboard_template.json) + + [企业门户 EWP](templates/ewp_dashboard_template.json) 4. 效果展示: >ECS: > ![img.png](pic/ecs.jpg) diff --git a/logs/logs.go b/logs/logs.go index f6117373..9231929d 100644 --- a/logs/logs.go +++ b/logs/logs.go @@ -1,9 +1,12 @@ package logs import ( + "errors" "fmt" "io/ioutil" "os" + "path/filepath" + "regexp" "strings" "time" @@ -78,8 +81,13 @@ func (c ConfLoader) LoadData(data []byte, cfg interface{}) error { } func InitLog(logsConfPath string) { + realPath, pathErr := NormalizePath(logsConfPath) + if pathErr != nil { + fmt.Printf("Normalize endpoint config err: %s", pathErr.Error()) + return + } var cfg map[string][]Config - err := newYamlLoader().LoadFile(logsConfPath, &cfg) + err := newYamlLoader().LoadFile(realPath, &cfg) if err != nil { fmt.Printf("Fail to load logs.yml, error: %s", err.Error()) return @@ -218,3 +226,16 @@ func makeZapLogger(cfg []Config) *zap.Logger { } return zap.New(zapcore.NewTee(cores...), zap.AddCaller()) } + +func NormalizePath(path string) (string, error) { + relPath, err := filepath.Abs(path) // 对文件路径进行标准化 + if err != nil { + return "", err + } + relPath = strings.Replace(relPath, "\\", "/", -1) + match, err := regexp.MatchString("[!;<>&|$\n`\\\\]", relPath) + if match || err != nil { + return "", errors.New("match path error") + } + return relPath, nil +} diff --git a/main.go b/main.go index 79c1d830..df40f7dc 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "strings" - "time" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" @@ -19,8 +18,12 @@ var ( clientConfig = flag.String("config", "./clouds.yml", "Path to the cloud configuration file") // 安全模式,从用户交互输入获取ak/sk,避免明文ak/sk敏感信息存储在配置文件中 securityMod = flag.Bool("s", false, "Get ak sk from command line") - getVersion = flag.Bool("v", false, "Get version from command line") - ak, sk string + // 以https协议启动cloudeye-exporter,需要从用户交互输入获取ca证书路径,服务端https证书路径,服务端私钥路径以及私钥密码 + httpsEnabled = flag.Bool("k", false, "Start the cloudeye exporter service in https mode") + getVersion = flag.Bool("v", false, "Get version from command line") + proxyEnabled = flag.Bool("p", false, "Start the cloudeye exporter service and start the proxy") + + ak, sk, proxyUserName, proxyPassword string ) func handler(w http.ResponseWriter, r *http.Request) { @@ -60,7 +63,7 @@ func getAkSkFromCommandLine() { if *securityMod { collector.SecurityMod = *securityMod // 用户交互输入ak/sk,避免明文配置敏感信息 - fmt.Print("Please input ak&sk split with space: (eg: {example_ak example_sk})") + fmt.Print("Please input ak&sk split with space(eg: {example_ak example_sk}): \n") _, err := fmt.Scanln(&ak, &sk) if err != nil { fmt.Printf("Read ak sk error: %s", err.Error()) @@ -71,6 +74,27 @@ func getAkSkFromCommandLine() { } } +func getProxyInfoFromCommandLine() { + if *proxyEnabled { + collector.ProxyEnabled = *proxyEnabled + // 用户交互输入代理userName/password,避免明文配置敏感信息 + fmt.Print("Please input proxy userName&proxy password split with space(eg: {example_proxy_user_name example_proxy_password}): \n") + _, err := fmt.Scanln(&proxyUserName, &proxyPassword) + if err != nil { + fmt.Printf("Read proxy info error: %s", err.Error()) + return + } + collector.TmpProxyUserName = proxyUserName + collector.TmpProxyPassword = proxyPassword + } +} + +func getHttpsEnabledFromCommandLine() { + if *httpsEnabled { + collector.HttpsEnabled = *httpsEnabled + } +} + func getVersionFunc() { if *getVersion { fmt.Printf("Cloudeye-exporter version: %s", collector.Version) @@ -82,20 +106,14 @@ func main() { flag.Parse() getVersionFunc() getAkSkFromCommandLine() + getHttpsEnabledFromCommandLine() + getProxyInfoFromCommandLine() initConf() + initCache() http.HandleFunc(collector.CloudConf.Global.MetricPath, handler) http.HandleFunc(collector.CloudConf.Global.EpsInfoPath, epHandler) - server := &http.Server{ - Addr: collector.CloudConf.Global.Port, - ReadTimeout: 30 * time.Second, - WriteTimeout: 60 * time.Second, - } - logs.Logger.Info("Start server at ", collector.CloudConf.Global.Port) - if err := server.ListenAndServe(); err != nil { - logs.Logger.Errorf("Error occur when start server %s", err.Error()) - logs.FlushLogAndExit(1) - } + collector.StartServer() } func initConf() { @@ -113,3 +131,7 @@ func initConf() { } collector.InitEndpointConfig(collector.CloudConf.Global.EndpointsConfPath) } + +func initCache() { + collector.GetAgentDimensionRefresher().RefreshAgentDimensionWithInterval() +} diff --git a/metric.yml b/metric.yml index e74dde73..0d8b29cb 100644 --- a/metric.yml +++ b/metric.yml @@ -2723,4 +2723,14 @@ SYS.EG: - sub_num - sub_retry_rate - sub_success_num - - sub_retry_num \ No newline at end of file + - sub_retry_num +SYS.EWP: + dim_metric_name: + user_id: + - total_request_success_rate + - site_list_clicks + - site_list_request_failed_rate + - template_list_clicks + site_id: + - website_design_clicks + - website_design_request_failed_rate \ No newline at end of file