From e0c0d372a246e9d6242fa41b0c20058f00d74739 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Sun, 2 Jul 2023 03:46:52 +0800 Subject: [PATCH] update metrics config --- .../admin_service/grafana/Admin Service.json | 266 +++++++++++++++++- statsd_mapping.yml | 72 ++++- 2 files changed, 325 insertions(+), 13 deletions(-) diff --git a/service_configs/admin_service/grafana/Admin Service.json b/service_configs/admin_service/grafana/Admin Service.json index 364ead5..56d7688 100644 --- a/service_configs/admin_service/grafana/Admin Service.json +++ b/service_configs/admin_service/grafana/Admin Service.json @@ -78,17 +78,17 @@ "steppedLine": false, "targets": [ { - "expr": "hello", + "expr": "captcha_image", "format": "time_series", "hide": false, "intervalFactor": 2, - "legendFormat": "hello {{quantile}}", + "legendFormat": "captcha_image {{quantile}}", "refId": "A" } ], "thresholds": [], "timeRegions": [], - "title": "Admin Service | Hello", + "title": "User Service | Captcha Image", "tooltip": { "shared": true, "sort": 0, @@ -163,16 +163,268 @@ "steppedLine": false, "targets": [ { - "expr": "error", + "expr": "login", "format": "time_series", "intervalFactor": 2, - "legendFormat": "error {{quantile}}", + "legendFormat": "login {{quantile}}", "refId": "A" } ], "thresholds": [], "timeRegions": [], - "title": "Admin Service | Error", + "title": "User Service | Login", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "5qrwjFCnk" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "get_info", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "get_info {{quantile}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "User Service | Get Info", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "5qrwjFCnk" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "get_profile", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "get_profile {{quantile}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "User Service | Get Profile", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "5qrwjFCnk" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.5", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "tenants", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "tenants {{quantile}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Permission Service | Tenants", "tooltip": { "shared": true, "sort": 0, @@ -201,7 +453,7 @@ } } ], - "refresh": "10s", + "refresh": "5s", "schemaVersion": 36, "style": "dark", "tags": [], diff --git a/statsd_mapping.yml b/statsd_mapping.yml index 9b4947d..ac13857 100644 --- a/statsd_mapping.yml +++ b/statsd_mapping.yml @@ -1,11 +1,11 @@ mappings: -- match: "admin-service.admin-service.hello" +- match: "user-service.user-service.captcha_image" observer_type: summary - name: "hello" + name: "captcha_image" labels: provider: "$2" outcome: "$3" - job: "admin-service" + job: "user-service" summary_options: quantiles: - quantile: 0.99 @@ -19,13 +19,73 @@ mappings: max_summary_age: 30s summary_age_buckets: 3 stream_buffer_size: 1000 -- match: "admin-service.admin-service.error" +- match: "user-service.user-service.login" observer_type: summary - name: "error" + name: "login" labels: provider: "$2" outcome: "$3" - job: "admin-service" + job: "user-service" + summary_options: + quantiles: + - quantile: 0.99 + error: 0.001 + - quantile: 0.95 + error: 0.01 + - quantile: 0.9 + error: 0.05 + - quantile: 0.5 + error: 0.005 + max_summary_age: 30s + summary_age_buckets: 3 + stream_buffer_size: 1000 +- match: "user-service.user-service.get_info" + observer_type: summary + name: "get_info" + labels: + provider: "$2" + outcome: "$3" + job: "user-service" + summary_options: + quantiles: + - quantile: 0.99 + error: 0.001 + - quantile: 0.95 + error: 0.01 + - quantile: 0.9 + error: 0.05 + - quantile: 0.5 + error: 0.005 + max_summary_age: 30s + summary_age_buckets: 3 + stream_buffer_size: 1000 +- match: "user-service.user-service.get_profile" + observer_type: summary + name: "get_profile" + labels: + provider: "$2" + outcome: "$3" + job: "user-service" + summary_options: + quantiles: + - quantile: 0.99 + error: 0.001 + - quantile: 0.95 + error: 0.01 + - quantile: 0.9 + error: 0.05 + - quantile: 0.5 + error: 0.005 + max_summary_age: 30s + summary_age_buckets: 3 + stream_buffer_size: 1000 +- match: "permission-service.permission-service.tenants" + observer_type: summary + name: "tenants" + labels: + provider: "$2" + outcome: "$3" + job: "permission-service" summary_options: quantiles: - quantile: 0.99