diff --git a/inputs/mongodb/dashboard.json b/inputs/mongodb/dashboard.json index ee439a1d..6fdfbd20 100644 --- a/inputs/mongodb/dashboard.json +++ b/inputs/mongodb/dashboard.json @@ -1,1176 +1,2044 @@ { - "name": "MongoDB", - "tags": "Prometheus MongoDB", - "configs": { - "var": [ - { - "name": "cluster", - "type": "query", - "definition": "label_values(mongodb_ss_uptime,cluster)" - }, + "name": "MongoDB", + "tags": "Prometheus MongoDB", + "configs": { + "var": [ + { + "name": "cluster", + "type": "query", + "definition": "label_values(mongodb_up,cluster)" + }, + { + "name": "topology", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\"}, topology)", + "multi": true, + "allOption": true + }, + { + "name": "component", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\"}, component)", + "multi": true, + "allOption": true + }, + { + "name": "instance", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\", component=~\"$component\"}, instance)", + "multi": true, + "allOption": true + } + ], + "version": "2.0.0", + "panels": [ + { + "id": "939298f2-b21f-4e2f-9142-c10946cc4032", + "type": "row", + "name": "Basic Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 0, + "i": "939298f2-b21f-4e2f-9142-c10946cc4032", + "isResizable": false + }, + "collapsed": true + }, + { + "type": "stat", + "id": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 1, + "i": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(mongodb_up{cluster=\"$cluster\", instance=~\"$instance\"})" + } + ], + "name": "Up", + "description": "正常实例数", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [], + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + } + }, + { + "type": "stat", + "id": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 1, + "i": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Uptime", + "description": "启用时长", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": { + "title": null + } + }, + "options": { + "valueMappings": [ { - "name": "cl_role", - "type": "query", - "definition": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\"}, cl_role)" + "type": "range", + "match": { + "to": 1800 + }, + "result": { + "color": "#ec7718" + } }, { - "name": "instance", - "type": "query", - "definition": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\", cl_role=~\"$cl_role\"}, instance)", - "multi": false + "type": "range", + "match": { + "from": 1800 + }, + "result": { + "color": "#53b503" + } } + ], + "standardOptions": { + "util": "humantimeSeconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + } + }, + { + "type": "timeseries", + "id": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 1, + "i": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_mem_resident{cluster=\"$cluster\", instance=~\"$instance\"} * 1024 * 1024", + "legend": "{{instance}}" + } ], + "name": "Memory", + "description": "内存占用(MiB)", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 1, + "i": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "isResizable": true + }, "version": "2.0.0", - "panels": [ - { - "id": "939298f2-b21f-4e2f-9142-c10946cc4032", - "type": "row", - "name": "Basic Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 0, - "i": "939298f2-b21f-4e2f-9142-c10946cc4032", - "isResizable": false - }, - "collapsed": true - }, - { - "type": "stat", - "id": "91970d24-3f04-4424-a1ed-73e7d28f5706", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 1, - "i": "91970d24-3f04-4424-a1ed-73e7d28f5706", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_up{cluster=\"$cluster\", instance=\"$instance\"}" - } - ], - "name": "Up", - "description": "实例数", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": {} - }, - "options": { - "valueMappings": [ - { - "type": "special", - "match": { - "from": 1, - "special": 1 - }, - "result": { - "color": "#53b503", - "text": "UP" - } - } - ], - "standardOptions": { - "util": "none" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } - }, - { - "type": "stat", - "id": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 1, - "i": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=\"$instance\"}" - } - ], - "name": "Uptime", - "description": "启用时长", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": { - "title": null - } - }, - "options": { - "valueMappings": [ - { - "type": "range", - "match": { - "to": 1800 - }, - "result": { - "color": "#ec7718" - } - }, - { - "type": "range", - "match": { - "from": 1800 - }, - "result": { - "color": "#53b503" - } - } - ], - "standardOptions": { - "util": "humantimeSeconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } - }, - { - "type": "timeseries", - "id": "8446dded-9e11-4ee9-bdad-769b193ddf3e", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 1, - "i": "8446dded-9e11-4ee9-bdad-769b193ddf3e", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_mem_resident{cluster='$cluster', cl_role=\"mongos\"} * 1024 * 1024", - "legend": "{{instance}}" - } - ], - "name": "Memory", - "description": "内存占用(MiB)", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesIEC" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "3eda28e7-2480-4ddc-b346-89ced1c33034", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 1, - "i": "3eda28e7-2480-4ddc-b346-89ced1c33034", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "legend": "page faults" - } - ], - "name": "Page Faults", - "description": "页缺失中断次数 Page faults indicate that requests are processed from disk either because an index is missing or there is not enough memory for the data set. Consider increasing memory or sharding out.", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "none", - "decimals": null - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "528d0485-f947-470d-95f3-59eae157ebb6", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 8, - "i": "528d0485-f947-470d-95f3-59eae157ebb6", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "legend": "bytesOut" - }, - { - "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "bytesIn" - } - ], - "name": "Network I/O", - "description": "网络流量(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesSI" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "067e97c3-4e57-447f-a9dc-a49627b6ce18", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 8, - "i": "067e97c3-4e57-447f-a9dc-a49627b6ce18", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "legend": "Connections" - } - ], - "name": "Connections", - "description": "连接数 Keep in mind the hard limit on the maximum number of connections set by your distribution.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 8, - "i": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "legend": "{{assert_type}}" - } - ], - "name": "Assert Events", - "description": "断言错误次数 Asserts are not important by themselves, but you can correlate spikes with other graphs.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "2698f0f8-a76a-499b-99cf-30504f0f4db6", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 8, - "i": "2698f0f8-a76a-499b-99cf-30504f0f4db6", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "legend": "{{count_type}}" - } - ], - "name": "Lock Queue", - "description": "等待获取锁操作数量 Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it before requests get stuck in the queue.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "id": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", - "type": "row", - "name": "Operation Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 15, - "i": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", - "isResizable": false - }, - "collapsed": true - }, - { - "type": "timeseries", - "id": "c2819508-95e7-4c63-aeae-ce19f92469cd", - "layout": { - "h": 7, - "w": 12, - "x": 0, - "y": 16, - "i": "c2819508-95e7-4c63-aeae-ce19f92469cd", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", - "legend": "{{legacy_op_type}}" - }, - { - "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", - "refId": "B", - "legend": "repl_{{legacy_op_type}}" - }, - { - "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[1m])", - "refId": "C", - "legend": "ttl_delete" - } - ], - "name": "Command Operations", - "description": "接收请求数 Shows how many times a command is executed per second on average during the selected interval.", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "7030d97a-d69f-4916-a415-ec57503ab1ed", - "layout": { - "h": 7, - "w": 12, - "x": 12, - "y": 16, - "i": "7030d97a-d69f-4916-a415-ec57503ab1ed", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "legend": "{{doc_op_type}}" - } - ], - "name": "Document Operations", - "description": "文档操作数 When used in combination with 'Command Operations', this graph can help identify write amplification. For example, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of documents.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "1c3b73d5-c25c-449f-995d-26acc9c621e1", - "layout": { - "h": 7, - "w": 8, - "x": 0, - "y": 23, - "i": "1c3b73d5-c25c-449f-995d-26acc9c621e1", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_opLatencies_latency{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_ss_opLatencies_ops{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", - "legend": "{{op_type}}" - } - ], - "name": "Response Time", - "description": "操作详情耗时(毫秒)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "milliseconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "e642183c-8ba2-4f60-abc6-c65de49e7577", - "layout": { - "h": 7, - "w": 8, - "x": 8, - "y": 23, - "i": "e642183c-8ba2-4f60-abc6-c65de49e7577", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scannedObjects{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", - "legend": "Document" - }, - { - "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scanned{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", - "refId": "B", - "legend": "Index" - } - ], - "name": "Query Efficiency", - "description": "查询效率", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "percentUnit" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "8b5a4f44-3291-4822-ab73-f56be6c62674", - "layout": { - "h": 7, - "w": 8, - "x": 16, - "y": 23, - "i": "8b5a4f44-3291-4822-ab73-f56be6c62674", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "legend": "{{csr_type}}" - } - ], - "name": "Cursors", - "description": "游标数量 Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed after 10 minutes due to an application not closing the connection.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "id": "06946b19-94b4-4f72-bd87-70f87989257d", - "type": "row", - "name": "Cache Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 30, - "i": "06946b19-94b4-4f72-bd87-70f87989257d", - "isResizable": false - }, - "collapsed": true, - "panels": [] - }, - { - "type": "timeseries", - "id": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 31, - "i": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "legend": "total" - }, - { - "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "refId": "B", - "legend": "dirty" - }, - { - "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "refId": "C", - "legend": "internal_pages" - }, - { - "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", - "refId": "D", - "legend": "leaf_pages" - } - ], - "name": "Cache Size", - "description": "缓存大小(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesIEC" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 31, - "i": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_ss_wt_cache_bytes_read_into_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "read" - }, - { - "expr": "rate(mongodb_ss_wt_cache_bytes_written_from_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "written" - } - ], - "name": "Cache I/O", - "description": "写入或读取的缓存数据大小(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesSI" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "43ee140d-ae6d-474a-9892-fa4743d7f97e", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 31, - "i": "43ee140d-ae6d-474a-9892-fa4743d7f97e", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"})", - "legend": "dirty rate" - } - ], - "name": "Cache Dirty Pages Rate", - "description": "缓存脏页占比", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "percent" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "type": "timeseries", - "id": "1a22c31a-859a-400c-af2a-ae83c308d0f2", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 31, - "i": "1a22c31a-859a-400c-af2a-ae83c308d0f2", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_mongod_wiredtiger_cache_evicted_total{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "evicted pages" - } - ], - "name": "Cache Evicted Pages", - "description": "缓存剔除页数量", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, - { - "id": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", - "type": "row", - "name": "ReplSet Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 38, - "i": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", - "isResizable": false - }, - "collapsed": true - }, + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "page faults" + } + ], + "name": "Page Faults", + "description": "页缺失中断次数 Page faults indicate that requests are processed from disk either because an index is missing or there is not enough memory for the data set. Consider increasing memory or sharding out.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none", + "decimals": null + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "528d0485-f947-470d-95f3-59eae157ebb6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 8, + "i": "528d0485-f947-470d-95f3-59eae157ebb6", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "bytesOut" + }, + { + "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "bytesIn" + } + ], + "name": "Network I/O", + "description": "网络流量(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 8, + "i": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", instance=~\"$instance\"}", + "legend": "Connections" + } + ], + "name": "Connections", + "description": "连接数 Keep in mind the hard limit on the maximum number of connections set by your distribution.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 8, + "i": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{assert_type}}" + } + ], + "name": "Assert Events", + "description": "断言错误次数 Asserts are not important by themselves, but you can correlate spikes with other graphs.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 8, + "i": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{count_type}}" + } + ], + "name": "Lock Queue", + "description": "等待获取锁操作数量 Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it before requests get stuck in the queue.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "type": "row", + "name": "Operation Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 15, + "i": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "isResizable": false + }, + "collapsed": true + }, + { + "type": "timeseries", + "id": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 16, + "i": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", + "legend": "{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", + "refId": "B", + "legend": "repl_{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", + "refId": "C", + "legend": "ttl_delete" + } + ], + "name": "Command Operations", + "description": "接收请求数 Shows how many times a command is executed per second on average during the selected interval.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 16, + "i": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{doc_op_type}}" + } + ], + "name": "Document Operations", + "description": "文档操作数 When used in combination with 'Command Operations', this graph can help identify write amplification. For example, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of documents.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 23, + "i": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opLatencies_latency{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_ss_opLatencies_ops{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", + "legend": "{{op_type}}" + } + ], + "name": "Response Time", + "description": "操作详情耗时(毫秒)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "milliseconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 23, + "i": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scannedObjects{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "legend": "Document" + }, + { + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scanned{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "refId": "B", + "legend": "Index" + } + ], + "name": "Query Efficiency", + "description": "查询效率", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percentUnit" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 23, + "i": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{csr_type}}" + } + ], + "name": "Cursors", + "description": "游标数量 Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed after 10 minutes due to an application not closing the connection.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "06946b19-94b4-4f72-bd87-70f87989257d", + "type": "row", + "name": "Cache Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 30, + "i": "06946b19-94b4-4f72-bd87-70f87989257d", + "isResizable": false + }, + "collapsed": true, + "panels": [] + }, + { + "type": "timeseries", + "id": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 31, + "i": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "total" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "B", + "legend": "dirty" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "C", + "legend": "internal_pages" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "D", + "legend": "leaf_pages" + } + ], + "name": "Cache Size", + "description": "缓存大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 31, + "i": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_wt_cache_bytes_read_into_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "read" + }, + { + "expr": "rate(mongodb_ss_wt_cache_bytes_written_from_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "written" + } + ], + "name": "Cache I/O", + "description": "写入或读取的缓存数据大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 31, + "i": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"})", + "legend": "dirty rate" + } + ], + "name": "Cache Dirty Pages Rate", + "description": "缓存脏页占比", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percent" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 31, + "i": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_mongod_wiredtiger_cache_evicted_total{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "evicted pages" + } + ], + "name": "Cache Evicted Pages", + "description": "缓存剔除页数量", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "type": "row", + "name": "ReplSet Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 38, + "i": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "isResizable": false + }, + "collapsed": true + }, + { + "type": "stat", + "id": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 39, + "i": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Replset Election", + "description": "副本集选主时间", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [ { - "type": "stat", - "id": "6187ceee-7c25-43f2-be1b-c44ad612ab52", - "layout": { - "h": 7, - "w": 12, - "x": 0, - "y": 39, - "i": "6187ceee-7c25-43f2-be1b-c44ad612ab52", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=\"$instance\"}" - } - ], - "name": "Replset Election", - "description": "副本集选主时间", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": {} - }, - "options": { - "valueMappings": [ - { - "type": "range", - "match": { - "to": 1800 - }, - "result": { - "color": "#f24526" - } - }, - { - "type": "range", - "match": { - "from": 1800 - }, - "result": { - "color": "#53b503" - } - } - ], - "standardOptions": { - "util": "seconds", - "decimals": 1 - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } + "type": "range", + "match": { + "to": 1800 + }, + "result": { + "color": "#f24526" + } }, { - "type": "timeseries", - "id": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", - "layout": { - "h": 7, - "w": 12, - "x": 12, - "y": 39, - "i": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", - "isResizable": true - }, - "version": "2.0.0", - "targets": [ - { - "refId": "A", - "expr": "mongodb_mongod_replset_member_replication_lag{cluster=\"$cluster\"}", - "legend": "{{set}} {{name}}" - } - ], - "name": "Replset Lag Seconds", - "description": "副本集成员主从同步延迟", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "seconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } + "type": "range", + "match": { + "from": 1800 + }, + "result": { + "color": "#53b503" + } } - ] - } -} \ No newline at end of file + ], + "standardOptions": { + "util": "seconds", + "decimals": 1 + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + } + }, + { + "type": "timeseries", + "id": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 39, + "i": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_member_replication_lag{cluster=\"$cluster\"}", + "legend": "{{set}} {{name}}" + } + ], + "name": "Replset Lag Seconds", + "description": "副本集成员主从同步延迟", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "d5186520-d940-133c-e8bb-abaebd0b6083", + "type": "row", + "name": "Replica Set Details", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 46, + "i": "d5186520-d940-133c-e8bb-abaebd0b6083", + "isResizable": false + }, + "collapsed": true, + "version": "2.0.0" + }, + { + "type": "timeseries", + "id": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 47, + "i": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_my_state{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Replset Member State", + "description": "当前实例在副本集中的状态,1 表示 Primary,2 表示 Secondary。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "64066067-72ce-41fd-3ccf-50e394aaa582", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 47, + "i": "64066067-72ce-41fd-3ccf-50e394aaa582", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_members_health{cluster=\"$cluster\"}", + "legend": "{{replset}} {{member_idx}} {{member_state}}" + } + ], + "name": "Replset Member Health", + "description": "副本集成员健康状态,1 表示健康。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 47, + "i": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_oplog_head_timestamp{cluster=\"$cluster\", instance=~\"$instance\"} - mongodb_mongod_replset_oplog_tail_timestamp{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Oplog Window", + "description": "oplog 可保留的时间窗口,窗口太小会放大 Secondary 追不上后全量同步的风险。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 47, + "i": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_oplog_stats_storageStats_size{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} used" + }, + { + "refId": "B", + "expr": "mongodb_oplog_stats_storageStats_maxSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} max" + } + ], + "name": "Oplog Used Bytes", + "description": "oplog 当前大小和最大容量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "type": "row", + "name": "Storage & Database", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 54, + "i": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "isResizable": false + }, + "collapsed": true, + "version": "2.0.0" + }, + { + "type": "timeseries", + "id": "49c3142f-aa96-d8d3-d336-7348807655ea", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 55, + "i": "49c3142f-aa96-d8d3-d336-7348807655ea", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_dataSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} data" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} index" + }, + { + "refId": "C", + "expr": "mongodb_dbstats_storageSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} storage" + } + ], + "name": "Database Size", + "description": "库级数据、索引和存储占用。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 55, + "i": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_collections{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} collections" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexes{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} indexes" + } + ], + "name": "Collections / Indexes", + "description": "库级集合数和索引数,用于发现异常膨胀。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 55, + "i": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "topk(10, rate(mongodb_indexstats_accesses_ops{cluster=\"$cluster\", instance=~\"$instance\"}[5m]))", + "legend": "{{database}}.{{collection}} {{key_name}}" + } + ], + "name": "Index Access Rate", + "description": "索引访问速率 Top 10,用于识别热点集合和索引。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ops" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "type": "row", + "name": "WiredTiger Pressure", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 62, + "i": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "isResizable": false + }, + "collapsed": true, + "version": "2.0.0" + }, + { + "type": "timeseries", + "id": "06f22cab-bafc-af29-b303-ec06c811faf3", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 63, + "i": "06f22cab-bafc-af29-b303-ec06c811faf3", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_available_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} available" + } + ], + "name": "WiredTiger Tickets Available", + "description": "WiredTiger 读写并发 ticket 可用数量,持续过低表示读写并发压力较高。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 63, + "i": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_out_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} out" + } + ], + "name": "WiredTiger Tickets Out", + "description": "WiredTiger 正在占用的读写 ticket 数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 63, + "i": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "increase(mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{instance}}" + } + ], + "name": "WiredTiger Checkpoint Time", + "description": "WiredTiger checkpoint 耗时增量,异常升高通常与磁盘写入压力相关。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ms" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "id": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "type": "row", + "name": "Sharded Cluster", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 70, + "i": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "isResizable": false + }, + "collapsed": true, + "version": "2.0.0" + }, + { + "type": "timeseries", + "id": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 71, + "i": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shards_total{cluster=\"$cluster\"}", + "legend": "shards" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_databases_total{cluster=\"$cluster\"}", + "legend": "databases" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_collections_total{cluster=\"$cluster\"}", + "legend": "collections" + } + ], + "name": "Shard / Collection Counts", + "description": "mongos 视角下的 shard、库和分片集合数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 71, + "i": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shard_chunks_total{cluster=\"$cluster\"}", + "legend": "{{shard}}" + } + ], + "name": "Chunk Distribution", + "description": "各 shard 的 chunk 分布,用于发现明显不均衡。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 71, + "i": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_balancer_enabled{cluster=\"$cluster\"}", + "legend": "balancer enabled" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_chunks_is_balanced{cluster=\"$cluster\"}", + "legend": "chunks balanced" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_shards_draining_total{cluster=\"$cluster\"}", + "legend": "draining shards" + } + ], + "name": "Balancer Status", + "description": "Balancer 是否启用、chunk 是否均衡以及是否存在 draining shard。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + }, + { + "type": "timeseries", + "id": "46a616bc-fb08-af56-a0a0-211789e97a53", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 71, + "i": "46a616bc-fb08-af56-a0a0-211789e97a53", + "isResizable": true + }, + "version": "2.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_chunks_total{cluster=\"$cluster\"}", + "legend": "chunks" + } + ], + "name": "Total Chunks", + "description": "mongos 视角下的分片集群总 chunk 数。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + } + } + ] + } +} diff --git a/inputs/mongodb/dashboard2.json b/inputs/mongodb/dashboard2.json index 31357bc0..fba64a76 100644 --- a/inputs/mongodb/dashboard2.json +++ b/inputs/mongodb/dashboard2.json @@ -1,1388 +1,4683 @@ { - "name": "MongoDB", - "tags": "Prometheus MongoDB", - "ident": "", - "configs": { - "var": [ + "name": "MongoDB", + "tags": "Prometheus MongoDB Categraf", + "ident": "", + "configs": { + "var": [ + { + "name": "datasource", + "type": "datasource", + "definition": "prometheus", + "defaultValue": 1, + "label": "Datasource", + "hide": false + }, + { + "name": "cluster", + "type": "query", + "definition": "label_values(mongodb_up,cluster)", + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "topology", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\"}, topology)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "component", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\"}, component)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "instance", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\", component=~\"$component\"}, instance)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + } + ], + "version": "3.0.0", + "panels": [ + { + "id": "939298f2-b21f-4e2f-9142-c10946cc4032", + "type": "row", + "name": "Basic Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 0, + "i": "939298f2-b21f-4e2f-9142-c10946cc4032", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "stat", + "id": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 1, + "i": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(mongodb_up{cluster=\"$cluster\", instance=~\"$instance\"})" + } + ], + "name": "Up", + "description": "正常实例数", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [], + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "stat", + "id": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 1, + "i": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Uptime", + "description": "启用时长", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": { + "title": null + } + }, + "options": { + "valueMappings": [ { - "name": "datasource", - "type": "datasource", - "definition": "prometheus", - "defaultValue": 2 + "type": "range", + "match": { + "to": 1800 + }, + "result": { + "color": "#ec7718" + } }, { - "name": "cluster", - "type": "query", - "datasource": { - "cate": "prometheus", - "value": "${datasource}" - }, - "definition": "label_values(mongodb_up,cluster)" + "type": "range", + "match": { + "from": 1800 + }, + "result": { + "color": "#53b503" + } + } + ], + "standardOptions": { + "util": "humantimeSeconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 1, + "i": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_mem_resident{cluster=\"$cluster\", instance=~\"$instance\"} * 1024 * 1024", + "legend": "{{instance}}" + } + ], + "name": "Memory", + "description": "内存占用(MiB)", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 1, + "i": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "page faults" + } + ], + "name": "Page Faults", + "description": "页缺失中断次数 Page faults indicate that requests are processed from disk either because an index is missing or there is not enough memory for the data set. Consider increasing memory or sharding out.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none", + "decimals": null + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "528d0485-f947-470d-95f3-59eae157ebb6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 8, + "i": "528d0485-f947-470d-95f3-59eae157ebb6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "bytesOut" + }, + { + "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "bytesIn" + } + ], + "name": "Network I/O", + "description": "网络流量(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 8, + "i": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", instance=~\"$instance\"}", + "legend": "Connections" + } + ], + "name": "Connections", + "description": "连接数 Keep in mind the hard limit on the maximum number of connections set by your distribution.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 8, + "i": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{assert_type}}" + } + ], + "name": "Assert Events", + "description": "断言错误次数 Asserts are not important by themselves, but you can correlate spikes with other graphs.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 8, + "i": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{count_type}}" + } + ], + "name": "Lock Queue", + "description": "等待获取锁操作数量 Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it before requests get stuck in the queue.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "type": "row", + "name": "Operation Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 15, + "i": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 16, + "i": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", + "legend": "{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", + "refId": "B", + "legend": "repl_{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", + "refId": "C", + "legend": "ttl_delete" + } + ], + "name": "Command Operations", + "description": "接收请求数 Shows how many times a command is executed per second on average during the selected interval.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 16, + "i": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{doc_op_type}}" + } + ], + "name": "Document Operations", + "description": "文档操作数 When used in combination with 'Command Operations', this graph can help identify write amplification. For example, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of documents.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 23, + "i": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opLatencies_latency{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_ss_opLatencies_ops{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", + "legend": "{{op_type}}" + } + ], + "name": "Response Time", + "description": "操作详情耗时(毫秒)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "milliseconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 23, + "i": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scannedObjects{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "legend": "Document" + }, + { + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scanned{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "refId": "B", + "legend": "Index" + } + ], + "name": "Query Efficiency", + "description": "查询效率", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percentUnit" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 23, + "i": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{csr_type}}" + } + ], + "name": "Cursors", + "description": "游标数量 Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed after 10 minutes due to an application not closing the connection.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "06946b19-94b4-4f72-bd87-70f87989257d", + "type": "row", + "name": "Cache Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 30, + "i": "06946b19-94b4-4f72-bd87-70f87989257d", + "isResizable": false + }, + "collapsed": true, + "panels": [], + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 31, + "i": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "total" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "B", + "legend": "dirty" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "C", + "legend": "internal_pages" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "D", + "legend": "leaf_pages" + } + ], + "name": "Cache Size", + "description": "缓存大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 31, + "i": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_wt_cache_bytes_read_into_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "read" + }, + { + "expr": "rate(mongodb_ss_wt_cache_bytes_written_from_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "written" + } + ], + "name": "Cache I/O", + "description": "写入或读取的缓存数据大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 31, + "i": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"})", + "legend": "dirty rate" + } + ], + "name": "Cache Dirty Pages Rate", + "description": "缓存脏页占比", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percent" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 31, + "i": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_mongod_wiredtiger_cache_evicted_total{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "evicted pages" + } + ], + "name": "Cache Evicted Pages", + "description": "缓存剔除页数量", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "type": "row", + "name": "ReplSet Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 38, + "i": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "stat", + "id": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 39, + "i": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Replset Election", + "description": "副本集选主时间", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [ + { + "type": "range", + "match": { + "to": 1800 + }, + "result": { + "color": "#f24526" + } }, { - "name": "instance", - "type": "query", - "datasource": { - "cate": "prometheus", - "value": "${datasource}" - }, - "definition": "label_values(mongodb_up{cluster=~\"$cluster\"}, instance)", - "multi": false + "type": "range", + "match": { + "from": 1800 + }, + "result": { + "color": "#53b503" + } } + ], + "standardOptions": { + "util": "seconds", + "decimals": 1 + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 39, + "i": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_member_replication_lag{cluster=\"$cluster\"}", + "legend": "{{set}} {{name}}" + } ], + "name": "Replset Lag Seconds", + "description": "副本集成员主从同步延迟", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "d5186520-d940-133c-e8bb-abaebd0b6083", + "type": "row", + "name": "Replica Set Details", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 46, + "i": "d5186520-d940-133c-e8bb-abaebd0b6083", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 47, + "i": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "isResizable": true + }, "version": "3.0.0", - "panels": [ + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_my_state{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Replset Member State", + "description": "当前实例在副本集中的状态,1 表示 Primary,2 表示 Secondary。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "64066067-72ce-41fd-3ccf-50e394aaa582", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 47, + "i": "64066067-72ce-41fd-3ccf-50e394aaa582", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_members_health{cluster=\"$cluster\"}", + "legend": "{{replset}} {{member_idx}} {{member_state}}" + } + ], + "name": "Replset Member Health", + "description": "副本集成员健康状态,1 表示健康。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 47, + "i": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_oplog_head_timestamp{cluster=\"$cluster\", instance=~\"$instance\"} - mongodb_mongod_replset_oplog_tail_timestamp{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Oplog Window", + "description": "oplog 可保留的时间窗口,窗口太小会放大 Secondary 追不上后全量同步的风险。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 47, + "i": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_oplog_stats_storageStats_size{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} used" + }, + { + "refId": "B", + "expr": "mongodb_oplog_stats_storageStats_maxSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} max" + } + ], + "name": "Oplog Used Bytes", + "description": "oplog 当前大小和最大容量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "type": "row", + "name": "Storage & Database", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 54, + "i": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "49c3142f-aa96-d8d3-d336-7348807655ea", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 55, + "i": "49c3142f-aa96-d8d3-d336-7348807655ea", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_dataSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} data" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} index" + }, + { + "refId": "C", + "expr": "mongodb_dbstats_storageSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} storage" + } + ], + "name": "Database Size", + "description": "库级数据、索引和存储占用。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 55, + "i": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_collections{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} collections" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexes{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} indexes" + } + ], + "name": "Collections / Indexes", + "description": "库级集合数和索引数,用于发现异常膨胀。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 55, + "i": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "topk(10, rate(mongodb_indexstats_accesses_ops{cluster=\"$cluster\", instance=~\"$instance\"}[5m]))", + "legend": "{{database}}.{{collection}} {{key_name}}" + } + ], + "name": "Index Access Rate", + "description": "索引访问速率 Top 10,用于识别热点集合和索引。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ops" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "type": "row", + "name": "WiredTiger Pressure", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 62, + "i": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "06f22cab-bafc-af29-b303-ec06c811faf3", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 63, + "i": "06f22cab-bafc-af29-b303-ec06c811faf3", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_available_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} available" + } + ], + "name": "WiredTiger Tickets Available", + "description": "WiredTiger 读写并发 ticket 可用数量,持续过低表示读写并发压力较高。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 63, + "i": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_out_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} out" + } + ], + "name": "WiredTiger Tickets Out", + "description": "WiredTiger 正在占用的读写 ticket 数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 63, + "i": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "increase(mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{instance}}" + } + ], + "name": "WiredTiger Checkpoint Time", + "description": "WiredTiger checkpoint 耗时增量,异常升高通常与磁盘写入压力相关。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ms" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "type": "row", + "name": "Sharded Cluster", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 70, + "i": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 71, + "i": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shards_total{cluster=\"$cluster\"}", + "legend": "shards" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_databases_total{cluster=\"$cluster\"}", + "legend": "databases" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_collections_total{cluster=\"$cluster\"}", + "legend": "collections" + } + ], + "name": "Shard / Collection Counts", + "description": "mongos 视角下的 shard、库和分片集合数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 71, + "i": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shard_chunks_total{cluster=\"$cluster\"}", + "legend": "{{shard}}" + } + ], + "name": "Chunk Distribution", + "description": "各 shard 的 chunk 分布,用于发现明显不均衡。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 71, + "i": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_balancer_enabled{cluster=\"$cluster\"}", + "legend": "balancer enabled" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_chunks_is_balanced{cluster=\"$cluster\"}", + "legend": "chunks balanced" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_shards_draining_total{cluster=\"$cluster\"}", + "legend": "draining shards" + } + ], + "name": "Balancer Status", + "description": "Balancer 是否启用、chunk 是否均衡以及是否存在 draining shard。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "46a616bc-fb08-af56-a0a0-211789e97a53", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 71, + "i": "46a616bc-fb08-af56-a0a0-211789e97a53", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_chunks_total{cluster=\"$cluster\"}", + "legend": "chunks" + } + ], + "name": "Total Chunks", + "description": "mongos 视角下的分片集群总 chunk 数。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + } + ] + }, + "var": [ + { + "name": "datasource", + "type": "datasource", + "definition": "prometheus", + "defaultValue": 1, + "label": "Datasource", + "hide": false + }, + { + "name": "cluster", + "type": "query", + "definition": "label_values(mongodb_up,cluster)", + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "topology", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\"}, topology)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "component", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\"}, component)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + }, + { + "name": "instance", + "type": "query", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\", component=~\"$component\"}, instance)", + "multi": true, + "allOption": true, + "datasource": { + "cate": "prometheus", + "value": "${datasource}" + }, + "reg": "", + "hide": false + } + ], + "panels": [ + { + "id": "939298f2-b21f-4e2f-9142-c10946cc4032", + "type": "row", + "name": "Basic Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 0, + "i": "939298f2-b21f-4e2f-9142-c10946cc4032", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "stat", + "id": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 1, + "i": "91970d24-3f04-4424-a1ed-73e7d28f5706", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(mongodb_up{cluster=\"$cluster\", instance=~\"$instance\"})" + } + ], + "name": "Up", + "description": "正常实例数", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [], + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ { - "id": "939298f2-b21f-4e2f-9142-c10946cc4032", - "type": "row", - "name": "Basic Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 0, - "i": "939298f2-b21f-4e2f-9142-c10946cc4032", - "isResizable": false - }, - "collapsed": true + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "stat", + "id": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 1, + "i": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Uptime", + "description": "启用时长", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": { + "title": null + } + }, + "options": { + "valueMappings": [ + { + "type": "range", + "match": { + "to": 1800 }, - { - "type": "stat", - "id": "91970d24-3f04-4424-a1ed-73e7d28f5706", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 1, - "i": "91970d24-3f04-4424-a1ed-73e7d28f5706", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_up{cluster=\"$cluster\", instance=\"$instance\"}" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Up", - "description": "实例数", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": {} - }, - "options": { - "valueMappings": [ - { - "type": "special", - "match": { - "from": 1, - "special": 1 - }, - "result": { - "color": "#53b503", - "text": "UP" - } - } - ], - "standardOptions": { - "util": "none" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } + "result": { + "color": "#ec7718" + } + }, + { + "type": "range", + "match": { + "from": 1800 }, + "result": { + "color": "#53b503" + } + } + ], + "standardOptions": { + "util": "humantimeSeconds" + }, + "thresholds": { + "steps": [ { - "type": "stat", - "id": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 1, - "i": "c7b52e8e-b417-4c61-a15e-e2f186fccd67", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_uptime_ns{cluster=\"$cluster\", instance=\"$instance\"}/10e9" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Uptime", - "description": "启用时长", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": { - "title": null - } - }, - "options": { - "valueMappings": [ - { - "type": "range", - "match": { - "to": 1800 - }, - "result": { - "color": "#ec7718" - } - }, - { - "type": "range", - "match": { - "from": 1800 - }, - "result": { - "color": "#53b503" - } - } - ], - "standardOptions": { - "util": "humantimeSeconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 1, + "i": "8446dded-9e11-4ee9-bdad-769b193ddf3e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_mem_resident{cluster=\"$cluster\", instance=~\"$instance\"} * 1024 * 1024", + "legend": "{{instance}}" + } + ], + "name": "Memory", + "description": "内存占用(MiB)", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "8446dded-9e11-4ee9-bdad-769b193ddf3e", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 1, - "i": "8446dded-9e11-4ee9-bdad-769b193ddf3e", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_resident_megabytes{cluster='$cluster',instance=\"$instance\"} *1024*1024", - "legend": "{{instance}}" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Memory", - "description": "内存占用(MiB)", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesIEC" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 1, + "i": "3eda28e7-2480-4ddc-b346-89ced1c33034", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "page faults" + } + ], + "name": "Page Faults", + "description": "页缺失中断次数 Page faults indicate that requests are processed from disk either because an index is missing or there is not enough memory for the data set. Consider increasing memory or sharding out.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none", + "decimals": null + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "3eda28e7-2480-4ddc-b346-89ced1c33034", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 1, - "i": "3eda28e7-2480-4ddc-b346-89ced1c33034", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_page_faults{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "page faults" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Page Faults", - "description": "页缺失中断次数 Page faults indicate that requests are processed from disk either because an index is missing or there is not enough memory for the data set. Consider increasing memory or sharding out.", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "none", - "decimals": null - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "528d0485-f947-470d-95f3-59eae157ebb6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 8, + "i": "528d0485-f947-470d-95f3-59eae157ebb6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "bytesOut" + }, + { + "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "bytesIn" + } + ], + "name": "Network I/O", + "description": "网络流量(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "528d0485-f947-470d-95f3-59eae157ebb6", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 8, - "i": "528d0485-f947-470d-95f3-59eae157ebb6", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_network_bytes_out{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "bytesOut" - }, - { - "expr": "rate(mongodb_network_bytes_in{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "bytesIn" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Network I/O", - "description": "网络流量(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesSI" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 8, + "i": "067e97c3-4e57-447f-a9dc-a49627b6ce18", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", instance=~\"$instance\"}", + "legend": "Connections" + } + ], + "name": "Connections", + "description": "连接数 Keep in mind the hard limit on the maximum number of connections set by your distribution.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "067e97c3-4e57-447f-a9dc-a49627b6ce18", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 8, - "i": "067e97c3-4e57-447f-a9dc-a49627b6ce18", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_connections_current{cluster=\"$cluster\", instance=~\"$instance\"}", - "legend": "Connections" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Connections", - "description": "连接数 Keep in mind the hard limit on the maximum number of connections set by your distribution.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 8, + "i": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{assert_type}}" + } + ], + "name": "Assert Events", + "description": "断言错误次数 Asserts are not important by themselves, but you can correlate spikes with other graphs.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 8, - "i": "9e9b7356-cf0e-4e5f-95f5-00258c576bf4", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_assert_warning{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "warning" - }, - { - "expr": "rate(mongodb_assert_rollovers{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "rollovers" - }, - { - "expr": "rate(mongodb_assert_msg{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "C", - "legend": "msg" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Assert Events", - "description": "断言次数统计 Asserts are not important by themselves, but you can correlate spikes with other graphs.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 8, + "i": "2698f0f8-a76a-499b-99cf-30504f0f4db6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{count_type}}" + } + ], + "name": "Lock Queue", + "description": "等待获取锁操作数量 Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it before requests get stuck in the queue.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "2698f0f8-a76a-499b-99cf-30504f0f4db6", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 8, - "i": "2698f0f8-a76a-499b-99cf-30504f0f4db6", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_global_lock_current_queue{cluster=\"$cluster\", instance=~\"$instance\"}", - "legend": "lock queue" - }, - { - "expr": "mongodb_global_lock_total_time{cluster=\"$cluster\",instance=\"$instance\"}", - "refId": "B", - "legend": "lock_total_time" - }, - { - "expr": "mongodb_global_lock_active_clients_readers{cluster=\"$cluster\",instance=\"$instance\"}", - "refId": "C", - "legend": "active_readers" - }, - { - "expr": "mongodb_global_lock_active_clients_writers{cluster=\"$cluster\",instance=\"$instance\"}", - "refId": "D", - "legend": "active_writers" - }, - { - "expr": "mongodb_global_lock_active_clients_total{cluster=\"$cluster\",instance=\"$instance\"}", - "refId": "E", - "legend": "active_client_total" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Lock Queue", - "description": "等待获取锁操作数量 Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it before requests get stuck in the queue.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "type": "row", + "name": "Operation Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 15, + "i": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 16, + "i": "c2819508-95e7-4c63-aeae-ce19f92469cd", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", + "legend": "{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", + "refId": "B", + "legend": "repl_{{legacy_op_type}}" + }, + { + "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", + "refId": "C", + "legend": "ttl_delete" + } + ], + "name": "Command Operations", + "description": "接收请求数 Shows how many times a command is executed per second on average during the selected interval.", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "id": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", - "type": "row", - "name": "Operation Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 15, - "i": "2bdb8cc9-92f4-449e-8f70-a4c470a21604", - "isResizable": false - }, - "collapsed": true - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 16, + "i": "7030d97a-d69f-4916-a415-ec57503ab1ed", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{doc_op_type}}" + } + ], + "name": "Document Operations", + "description": "文档操作数 When used in combination with 'Command Operations', this graph can help identify write amplification. For example, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of documents.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "c2819508-95e7-4c63-aeae-ce19f92469cd", - "layout": { - "h": 7, - "w": 12, - "x": 0, - "y": 16, - "i": "c2819508-95e7-4c63-aeae-ce19f92469cd", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_queries{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", - "legend": "queries" - }, - { - "expr": "rate(mongodb_repl_queries{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", - "refId": "B", - "legend": "repl_queries" - }, - { - "expr": "rate(mongodb_ttl_deletes{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", - "refId": "C", - "legend": "ttl_delete" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Command Operations", - "description": "接收请求数 Shows how many times a command is executed per second on average during the selected interval.", - "options": { - "tooltip": { - "mode": "all", - "sort": "desc" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 23, + "i": "1c3b73d5-c25c-449f-995d-26acc9c621e1", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_opLatencies_latency{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_ss_opLatencies_ops{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", + "legend": "{{op_type}}" + } + ], + "name": "Response Time", + "description": "操作详情耗时(毫秒)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "milliseconds" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "7030d97a-d69f-4916-a415-ec57503ab1ed", - "layout": { - "h": 7, - "w": 12, - "x": 12, - "y": 16, - "i": "7030d97a-d69f-4916-a415-ec57503ab1ed", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_document_inserted{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "inserted" - }, - { - "expr": "rate(mongodb_document_updated{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "updated" - }, - { - "expr": "rate(mongodb_document_deleted{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "C", - "legend": "deleted" - }, - { - "expr": "rate(mongodb_document_returned{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "D", - "legend": "returned" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Document Operations", - "description": "文档操作数 When used in combination with 'Command Operations', this graph can help identify write amplification. For example, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of documents.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 23, + "i": "e642183c-8ba2-4f60-abc6-c65de49e7577", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scannedObjects{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "legend": "Document" + }, + { + "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scanned{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", + "refId": "B", + "legend": "Index" + } + ], + "name": "Query Efficiency", + "description": "查询效率", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percentUnit" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "1c3b73d5-c25c-449f-995d-26acc9c621e1", - "layout": { - "h": 7, - "w": 8, - "x": 0, - "y": 23, - "i": "1c3b73d5-c25c-449f-995d-26acc9c621e1", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_latency_reads{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_latency_reads_count{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", - "legend": "read latancy" - }, - { - "expr": "rate(mongodb_latency_writes{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / rate(mongodb_latency_writes_count{cluster=~\"$cluster\", instance=~\"$instance\"}[1m]) / 1000", - "refId": "B", - "legend": "write" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Response Time", - "description": "操作详情耗时(毫秒)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "milliseconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 23, + "i": "8b5a4f44-3291-4822-ab73-f56be6c62674", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{csr_type}}" + } + ], + "name": "Cursors", + "description": "游标数量 Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed after 10 minutes due to an application not closing the connection.", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "e642183c-8ba2-4f60-abc6-c65de49e7577", - "layout": { - "h": 7, - "w": 8, - "x": 8, - "y": 23, - "i": "e642183c-8ba2-4f60-abc6-c65de49e7577", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scannedObjects{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", - "legend": "Document" - }, - { - "expr": "sum(increase(mongodb_ss_metrics_queryExecutor_scanned{cluster=\"$cluster\"}[5m])) / sum(increase(mongodb_ss_metrics_document{cluster=\"$cluster\", doc_op_type=\"returned\"}[5m]))", - "refId": "B", - "legend": "Index" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Query Efficiency", - "description": "查询效率", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "percentUnit" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "06946b19-94b4-4f72-bd87-70f87989257d", + "type": "row", + "name": "Cache Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 30, + "i": "06946b19-94b4-4f72-bd87-70f87989257d", + "isResizable": false + }, + "collapsed": true, + "panels": [], + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 31, + "i": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "total" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "B", + "legend": "dirty" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "C", + "legend": "internal_pages" + }, + { + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", + "refId": "D", + "legend": "leaf_pages" + } + ], + "name": "Cache Size", + "description": "缓存大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "8b5a4f44-3291-4822-ab73-f56be6c62674", - "layout": { - "h": 7, - "w": 8, - "x": 16, - "y": 23, - "i": "8b5a4f44-3291-4822-ab73-f56be6c62674", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_cursor_total{cluster=\"$cluster\", instance=~\"$instance\"}", - "legend": "" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Cursors", - "description": "游标数量 Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed after 10 minutes due to an application not closing the connection.", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 31, + "i": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_ss_wt_cache_bytes_read_into_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "read" + }, + { + "expr": "rate(mongodb_ss_wt_cache_bytes_written_from_cache{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "refId": "B", + "legend": "written" + } + ], + "name": "Cache I/O", + "description": "写入或读取的缓存数据大小(byte)", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesSI" + }, + "thresholds": { + "steps": [ { - "id": "06946b19-94b4-4f72-bd87-70f87989257d", - "type": "row", - "name": "Cache Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 30, - "i": "06946b19-94b4-4f72-bd87-70f87989257d", - "isResizable": false - }, - "collapsed": true, - "panels": [] - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 31, + "i": "43ee140d-ae6d-474a-9892-fa4743d7f97e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"})", + "legend": "dirty rate" + } + ], + "name": "Cache Dirty Pages Rate", + "description": "缓存脏页占比", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "percent" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", - "layout": { - "h": 7, - "w": 6, - "x": 0, - "y": 31, - "i": "bb0ae571-43a1-430b-8f63-256f6f1ebee6", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_wtcache_current_bytes{cluster=\"$cluster\", instance=~\"$instance\"}", - "legend": "total" - }, - { - "expr": "mongodb_wtcache_modified_pages_evicted{cluster=\"$cluster\", instance=~\"$instance\"}", - "refId": "B", - "legend": "dirty" - }, - { - "expr": "mongodb_wtcache_internal_pages_evicted{cluster=\"$cluster\", instance=~\"$instance\"}", - "refId": "C", - "legend": "internal_pages" - }, - { - "expr": "mongodb_wtcache_server_evicting_pages{cluster=\"$cluster\", instance=~\"$instance\"}", - "refId": "D", - "legend": "leaf_pages" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Cache Size", - "description": "缓存大小(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesIEC" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 31, + "i": "1a22c31a-859a-400c-af2a-ae83c308d0f2", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "rate(mongodb_mongod_wiredtiger_cache_evicted_total{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "evicted pages" + } + ], + "name": "Cache Evicted Pages", + "description": "缓存剔除页数量", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": {}, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", - "layout": { - "h": 7, - "w": 6, - "x": 6, - "y": 31, - "i": "f1ffd169-2a1a-42bc-9647-0e6621be0fef", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_wtcache_bytes_read_into{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "read" - }, - { - "expr": "rate(mongodb_wtcache_bytes_written_from{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "refId": "B", - "legend": "written" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Cache I/O", - "description": "写入或读取的缓存数据大小(byte)", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "bytesSI" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "type": "row", + "name": "ReplSet Info", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 38, + "i": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "stat", + "id": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "layout": { + "h": 7, + "w": 12, + "x": 0, + "y": 39, + "i": "6187ceee-7c25-43f2-be1b-c44ad612ab52", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=~\"$instance\"}" + } + ], + "name": "Replset Election", + "description": "副本集选主时间", + "custom": { + "textMode": "value", + "colorMode": "value", + "calc": "lastNotNull", + "valueField": "Value", + "colSpan": 1, + "textSize": {} + }, + "options": { + "valueMappings": [ + { + "type": "range", + "match": { + "to": 1800 }, - { - "type": "timeseries", - "id": "43ee140d-ae6d-474a-9892-fa4743d7f97e", - "layout": { - "h": 7, - "w": 6, - "x": 12, - "y": 31, - "i": "43ee140d-ae6d-474a-9892-fa4743d7f97e", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "100 * sum(mongodb_wtcache_tracked_dirty_bytes{cluster=\"$cluster\", instance=~\"$instance\"}) / sum(mongodb_wtcache_current_bytes{cluster=\"$cluster\", instance=~\"$instance\"})", - "legend": "dirty rate" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Cache Dirty Rate (bytes)", - "description": "缓存脏页占比", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "percent" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } + "result": { + "color": "#f24526" + } + }, + { + "type": "range", + "match": { + "from": 1800 }, + "result": { + "color": "#53b503" + } + } + ], + "standardOptions": { + "util": "seconds", + "decimals": 1 + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "1a22c31a-859a-400c-af2a-ae83c308d0f2", - "layout": { - "h": 7, - "w": 6, - "x": 18, - "y": 31, - "i": "1a22c31a-859a-400c-af2a-ae83c308d0f2", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "rate(mongodb_wtcache_modified_pages_evicted{cluster=~\"$cluster\", instance=~\"$instance\"}[5m])", - "legend": "evicted pages" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Cache Evicted Pages", - "description": "缓存剔除页数量", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": {}, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "layout": { + "h": 7, + "w": 12, + "x": 12, + "y": 39, + "i": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_member_replication_lag{cluster=\"$cluster\"}", + "legend": "{{set}} {{name}}" + } + ], + "name": "Replset Lag Seconds", + "description": "副本集成员主从同步延迟", + "options": { + "tooltip": { + "mode": "all", + "sort": "none" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ { - "id": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", - "type": "row", - "name": "ReplSet Info", - "layout": { - "h": 1, - "w": 24, - "x": 0, - "y": 38, - "i": "b0016f4a-c565-4276-a08d-bacdf94b6b5a", - "isResizable": false - }, - "collapsed": true - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "d5186520-d940-133c-e8bb-abaebd0b6083", + "type": "row", + "name": "Replica Set Details", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 46, + "i": "d5186520-d940-133c-e8bb-abaebd0b6083", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 47, + "i": "3d57485b-7abf-4d9e-31c0-9699532a7e0e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_my_state{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Replset Member State", + "description": "当前实例在副本集中的状态,1 表示 Primary,2 表示 Secondary。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ { - "type": "stat", - "id": "6187ceee-7c25-43f2-be1b-c44ad612ab52", - "layout": { - "h": 7, - "w": 12, - "x": 0, - "y": 39, - "i": "6187ceee-7c25-43f2-be1b-c44ad612ab52", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=\"$instance\"}" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Replset Election", - "description": "副本集选主时间", - "custom": { - "textMode": "value", - "colorMode": "value", - "calc": "lastNotNull", - "valueField": "Value", - "colSpan": 1, - "textSize": {} - }, - "options": { - "valueMappings": [ - { - "type": "range", - "match": { - "to": 1800 - }, - "result": { - "color": "#f24526" - } - }, - { - "type": "range", - "match": { - "from": 1800 - }, - "result": { - "color": "#53b503" - } - } - ], - "standardOptions": { - "util": "seconds", - "decimals": 1 - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - } - }, + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "64066067-72ce-41fd-3ccf-50e394aaa582", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 47, + "i": "64066067-72ce-41fd-3ccf-50e394aaa582", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_members_health{cluster=\"$cluster\"}", + "legend": "{{replset}} {{member_idx}} {{member_state}}" + } + ], + "name": "Replset Member Health", + "description": "副本集成员健康状态,1 表示健康。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ { - "type": "timeseries", - "id": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", - "layout": { - "h": 7, - "w": 12, - "x": 12, - "y": 39, - "i": "f73fd0cd-ecbe-41f0-a2dc-4e02f7eaef1c", - "isResizable": true - }, - "version": "3.0.0", - "datasourceCate": "prometheus", - "datasourceValue": "${datasource}", - "targets": [ - { - "refId": "A", - "expr": "mongodb_repl_lag{cluster=\"$cluster\"}", - "legend": "" - } - ], - "transformations": [ - { - "id": "organize", - "options": {} - } - ], - "name": "Replset Lag Seconds", - "description": "副本集成员主从同步延迟", - "options": { - "tooltip": { - "mode": "all", - "sort": "none" - }, - "legend": { - "displayMode": "hidden" - }, - "standardOptions": { - "util": "seconds" - }, - "thresholds": { - "steps": [ - { - "color": "#634CD9", - "value": null, - "type": "base" - } - ] - } - }, - "custom": { - "drawStyle": "lines", - "lineInterpolation": "smooth", - "spanNulls": false, - "lineWidth": 1, - "fillOpacity": 0.5, - "gradientMode": "none", - "stack": "off", - "scaleDistribution": { - "type": "linear" - } - } + "color": "#634CD9", + "value": null, + "type": "base" } - ] + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 47, + "i": "6de1cd91-b468-bb2d-264f-23228e1298d2", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_replset_oplog_head_timestamp{cluster=\"$cluster\", instance=~\"$instance\"} - mongodb_mongod_replset_oplog_tail_timestamp{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}}" + } + ], + "name": "Oplog Window", + "description": "oplog 可保留的时间窗口,窗口太小会放大 Secondary 追不上后全量同步的风险。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "seconds" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 47, + "i": "11662e21-7184-2c26-7c3c-4153e69fdabe", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_oplog_stats_storageStats_size{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} used" + }, + { + "refId": "B", + "expr": "mongodb_oplog_stats_storageStats_maxSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} max" + } + ], + "name": "Oplog Used Bytes", + "description": "oplog 当前大小和最大容量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "type": "row", + "name": "Storage & Database", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 54, + "i": "4e2c877e-185b-345d-a162-2941cb58e9d3", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "49c3142f-aa96-d8d3-d336-7348807655ea", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 55, + "i": "49c3142f-aa96-d8d3-d336-7348807655ea", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_dataSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} data" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} index" + }, + { + "refId": "C", + "expr": "mongodb_dbstats_storageSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} storage" + } + ], + "name": "Database Size", + "description": "库级数据、索引和存储占用。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "bytesIEC" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 55, + "i": "de7a6e36-68f2-626d-3146-d02d3bfb78f1", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_dbstats_collections{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} collections" + }, + { + "refId": "B", + "expr": "mongodb_dbstats_indexes{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{database}} indexes" + } + ], + "name": "Collections / Indexes", + "description": "库级集合数和索引数,用于发现异常膨胀。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 55, + "i": "fadc5b49-3d04-309d-00a2-5b9fcceb6771", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "topk(10, rate(mongodb_indexstats_accesses_ops{cluster=\"$cluster\", instance=~\"$instance\"}[5m]))", + "legend": "{{database}}.{{collection}} {{key_name}}" + } + ], + "name": "Index Access Rate", + "description": "索引访问速率 Top 10,用于识别热点集合和索引。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ops" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "type": "row", + "name": "WiredTiger Pressure", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 62, + "i": "40b0ff89-1edc-e446-5a0d-b6e0686667a5", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "06f22cab-bafc-af29-b303-ec06c811faf3", + "layout": { + "h": 7, + "w": 8, + "x": 0, + "y": 63, + "i": "06f22cab-bafc-af29-b303-ec06c811faf3", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_available_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} available" + } + ], + "name": "WiredTiger Tickets Available", + "description": "WiredTiger 读写并发 ticket 可用数量,持续过低表示读写并发压力较高。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "layout": { + "h": 7, + "w": 8, + "x": 8, + "y": 63, + "i": "2625636d-aaa8-2eac-4f13-8f84ea457b19", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_out_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legend": "{{instance}} {{txn_rw}} out" + } + ], + "name": "WiredTiger Tickets Out", + "description": "WiredTiger 正在占用的读写 ticket 数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "layout": { + "h": 7, + "w": 8, + "x": 16, + "y": 63, + "i": "4888f9eb-501b-1bfd-4cca-17fbc5e872da", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "increase(mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legend": "{{instance}}" + } + ], + "name": "WiredTiger Checkpoint Time", + "description": "WiredTiger checkpoint 耗时增量,异常升高通常与磁盘写入压力相关。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "ms" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "id": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "type": "row", + "name": "Sharded Cluster", + "layout": { + "h": 1, + "w": 24, + "x": 0, + "y": 70, + "i": "1dedd0fb-0605-5880-8d3a-eacd6004c235", + "isResizable": false + }, + "collapsed": true, + "version": "3.0.0" + }, + { + "type": "timeseries", + "id": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "layout": { + "h": 7, + "w": 6, + "x": 0, + "y": 71, + "i": "c14cd84a-e8a8-a6df-e7f2-b472c4d8d5b0", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shards_total{cluster=\"$cluster\"}", + "legend": "shards" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_databases_total{cluster=\"$cluster\"}", + "legend": "databases" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_collections_total{cluster=\"$cluster\"}", + "legend": "collections" + } + ], + "name": "Shard / Collection Counts", + "description": "mongos 视角下的 shard、库和分片集合数量。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "layout": { + "h": 7, + "w": 6, + "x": 6, + "y": 71, + "i": "50bd7496-5cbd-dae4-a427-4bb5af897026", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_shard_chunks_total{cluster=\"$cluster\"}", + "legend": "{{shard}}" + } + ], + "name": "Chunk Distribution", + "description": "各 shard 的 chunk 分布,用于发现明显不均衡。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "layout": { + "h": 7, + "w": 6, + "x": 12, + "y": 71, + "i": "5da8289e-b4b4-ce3b-7e56-8e9e7209041e", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_balancer_enabled{cluster=\"$cluster\"}", + "legend": "balancer enabled" + }, + { + "refId": "B", + "expr": "mongodb_mongos_sharding_chunks_is_balanced{cluster=\"$cluster\"}", + "legend": "chunks balanced" + }, + { + "refId": "C", + "expr": "mongodb_mongos_sharding_shards_draining_total{cluster=\"$cluster\"}", + "legend": "draining shards" + } + ], + "name": "Balancer Status", + "description": "Balancer 是否启用、chunk 是否均衡以及是否存在 draining shard。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] + }, + { + "type": "timeseries", + "id": "46a616bc-fb08-af56-a0a0-211789e97a53", + "layout": { + "h": 7, + "w": 6, + "x": 18, + "y": 71, + "i": "46a616bc-fb08-af56-a0a0-211789e97a53", + "isResizable": true + }, + "version": "3.0.0", + "targets": [ + { + "refId": "A", + "expr": "mongodb_mongos_sharding_chunks_total{cluster=\"$cluster\"}", + "legend": "chunks" + } + ], + "name": "Total Chunks", + "description": "mongos 视角下的分片集群总 chunk 数。", + "options": { + "tooltip": { + "mode": "all", + "sort": "desc" + }, + "legend": { + "displayMode": "hidden" + }, + "standardOptions": { + "util": "none" + }, + "thresholds": { + "steps": [ + { + "color": "#634CD9", + "value": null, + "type": "base" + } + ] + } + }, + "custom": { + "drawStyle": "lines", + "lineInterpolation": "smooth", + "spanNulls": false, + "lineWidth": 1, + "fillOpacity": 0.5, + "gradientMode": "none", + "stack": "off", + "scaleDistribution": { + "type": "linear" + } + }, + "datasourceCate": "prometheus", + "datasourceValue": "${datasource}", + "transformations": [ + { + "id": "organize", + "options": {} + } + ] } + ], + "version": "3.0.0" } diff --git a/inputs/mongodb/dashboard_grafana.json b/inputs/mongodb/dashboard_grafana.json index 98704332..50e2bc9c 100644 --- a/inputs/mongodb/dashboard_grafana.json +++ b/inputs/mongodb/dashboard_grafana.json @@ -55,7 +55,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_up{cluster=\"$cluster\", instance=\"$instance\"}", + "expr": "sum(mongodb_up{cluster=\"$cluster\", instance=~\"$instance\"})", "legendFormat": "", "range": true, "refId": "A" @@ -94,7 +94,7 @@ }, "textMode": "value" }, - "description": "实例数" + "description": "正常实例数" }, { "id": 3, @@ -117,7 +117,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=\"$instance\"}", + "expr": "mongodb_ss_uptime{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "", "range": true, "refId": "A" @@ -179,7 +179,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_mem_resident{cluster='$cluster', cl_role=\"mongos\"} * 1024 * 1024", + "expr": "mongodb_ss_mem_resident{cluster=\"$cluster\", instance=~\"$instance\"} * 1024 * 1024", "legendFormat": "{{instance}}", "range": true, "refId": "A" @@ -238,7 +238,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", + "expr": "rate(mongodb_ss_extra_info_page_faults{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", "legendFormat": "page faults", "range": true, "refId": "A" @@ -298,7 +298,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", + "expr": "rate(mongodb_ss_network_bytesOut{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", "legendFormat": "bytesOut", "range": true, "refId": "A" @@ -309,7 +309,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", + "expr": "rate(mongodb_ss_network_bytesIn{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", "legendFormat": "bytesIn", "range": true, "refId": "B" @@ -369,7 +369,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_connections{cluster=\"$cluster\", conn_type=\"current\", instance=~\"$instance\"}", "legendFormat": "Connections", "range": true, "refId": "A" @@ -428,7 +428,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", + "expr": "rate(mongodb_ss_asserts{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", "legendFormat": "{{assert_type}}", "range": true, "refId": "A" @@ -487,7 +487,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_globalLock_currentQueue{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "{{count_type}}", "range": true, "refId": "A" @@ -558,7 +558,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", + "expr": "rate(mongodb_ss_opcounters{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!=\"command\"}[1m])", "legendFormat": "{{legacy_op_type}}", "range": true, "refId": "A" @@ -569,7 +569,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", + "expr": "rate(mongodb_ss_opcountersRepl{cluster=\"$cluster\", instance=~\"$instance\", legacy_op_type!~\"(command|query|getmore)\"}[1m])", "legendFormat": "repl_{{legacy_op_type}}", "range": true, "refId": "B" @@ -580,7 +580,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[1m])", + "expr": "rate(mongodb_ss_metrics_ttl_deletedDocuments{cluster=\"$cluster\", instance=~\"$instance\"}[1m])", "legendFormat": "ttl_delete", "range": true, "refId": "C" @@ -639,7 +639,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}[5m])", + "expr": "rate(mongodb_ss_metrics_document{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", "legendFormat": "{{doc_op_type}}", "range": true, "refId": "A" @@ -828,7 +828,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_metrics_cursor_open{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "{{csr_type}}", "range": true, "refId": "A" @@ -899,7 +899,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_wt_cache_bytes_currently_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "total", "range": true, "refId": "A" @@ -910,7 +910,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_wt_cache_tracked_dirty_bytes_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "dirty", "range": true, "refId": "B" @@ -921,7 +921,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_internal_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "internal_pages", "range": true, "refId": "C" @@ -932,7 +932,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}", + "expr": "mongodb_ss_wt_cache_tracked_bytes_belonging_to_leaf_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "leaf_pages", "range": true, "refId": "D" @@ -1062,7 +1062,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", cl_role=~\"$cl_role\", instance=~\"$instance\"})", + "expr": "100 * sum(mongodb_ss_wt_cache_tracked_dirty_pages_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"}) / sum(mongodb_ss_wt_cache_pages_currently_held_in_the_cache{cluster=\"$cluster\", instance=~\"$instance\"})", "legendFormat": "dirty rate", "range": true, "refId": "A" @@ -1193,7 +1193,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=\"$instance\"}", + "expr": "time() - mongodb_mongod_replset_member_election_date{cluster=\"$cluster\", instance=~\"$instance\"}", "legendFormat": "", "range": true, "refId": "A" @@ -1294,6 +1294,973 @@ } }, "description": "副本集成员主从同步延迟" + }, + { + "id": 24, + "title": "Replica Set Details", + "type": "row", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "collapsed": false + }, + { + "id": 25, + "title": "Replset Member State", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 0, + "y": 47 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongod_replset_my_state{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "当前实例在副本集中的状态,1 表示 Primary,2 表示 Secondary。" + }, + { + "id": 26, + "title": "Replset Member Health", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 6, + "y": 47 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_members_health{cluster=\"$cluster\"}", + "legendFormat": "{{replset}} {{member_idx}} {{member_state}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "副本集成员健康状态,1 表示健康。" + }, + { + "id": 27, + "title": "Oplog Window", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 47 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongod_replset_oplog_head_timestamp{cluster=\"$cluster\", instance=~\"$instance\"} - mongodb_mongod_replset_oplog_tail_timestamp{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "seconds", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "oplog 可保留的时间窗口,窗口太小会放大 Secondary 追不上后全量同步的风险。" + }, + { + "id": 28, + "title": "Oplog Used Bytes", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 47 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_oplog_stats_storageStats_size{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}} used", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_oplog_stats_storageStats_maxSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}} max", + "range": true, + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "bytesIEC", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "oplog 当前大小和最大容量。" + }, + { + "id": 29, + "title": "Storage & Database", + "type": "row", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 54 + }, + "collapsed": false + }, + { + "id": 30, + "title": "Database Size", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 55 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_dbstats_dataSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{database}} data", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_dbstats_indexSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{database}} index", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_dbstats_storageSize{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{database}} storage", + "range": true, + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "unit": "bytesIEC", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "库级数据、索引和存储占用。" + }, + { + "id": 31, + "title": "Collections / Indexes", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 55 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_dbstats_collections{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{database}} collections", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_dbstats_indexes{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{database}} indexes", + "range": true, + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "库级集合数和索引数,用于发现异常膨胀。" + }, + { + "id": 32, + "title": "Index Access Rate", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 55 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topk(10, rate(mongodb_indexstats_accesses_ops{cluster=\"$cluster\", instance=~\"$instance\"}[5m]))", + "legendFormat": "{{database}}.{{collection}} {{key_name}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "ops", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "索引访问速率 Top 10,用于识别热点集合和索引。" + }, + { + "id": 33, + "title": "WiredTiger Pressure", + "type": "row", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 62 + }, + "collapsed": false + }, + { + "id": 34, + "title": "WiredTiger Tickets Available", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 63 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_available_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}} {{txn_rw}} available", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "WiredTiger 读写并发 ticket 可用数量,持续过低表示读写并发压力较高。" + }, + { + "id": 35, + "title": "WiredTiger Tickets Out", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 63 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongod_wiredtiger_concurrent_transactions_out_tickets{cluster=\"$cluster\", instance=~\"$instance\"}", + "legendFormat": "{{instance}} {{txn_rw}} out", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "WiredTiger 正在占用的读写 ticket 数量。" + }, + { + "id": 36, + "title": "WiredTiger Checkpoint Time", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 63 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "increase(mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total{cluster=\"$cluster\", instance=~\"$instance\"}[5m])", + "legendFormat": "{{instance}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "ms", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "WiredTiger checkpoint 耗时增量,异常升高通常与磁盘写入压力相关。" + }, + { + "id": 37, + "title": "Sharded Cluster", + "type": "row", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 70 + }, + "collapsed": false + }, + { + "id": 38, + "title": "Shard / Collection Counts", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 0, + "y": 71 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_shards_total{cluster=\"$cluster\"}", + "legendFormat": "shards", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_databases_total{cluster=\"$cluster\"}", + "legendFormat": "databases", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_collections_total{cluster=\"$cluster\"}", + "legendFormat": "collections", + "range": true, + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "mongos 视角下的 shard、库和分片集合数量。" + }, + { + "id": 39, + "title": "Chunk Distribution", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 6, + "y": 71 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_shard_chunks_total{cluster=\"$cluster\"}", + "legendFormat": "{{shard}}", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "各 shard 的 chunk 分布,用于发现明显不均衡。" + }, + { + "id": 40, + "title": "Balancer Status", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 71 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_balancer_enabled{cluster=\"$cluster\"}", + "legendFormat": "balancer enabled", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_chunks_is_balanced{cluster=\"$cluster\"}", + "legendFormat": "chunks balanced", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_shards_draining_total{cluster=\"$cluster\"}", + "legendFormat": "draining shards", + "range": true, + "refId": "C" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "Balancer 是否启用、chunk 是否均衡以及是否存在 draining shard。" + }, + { + "id": 41, + "title": "Total Chunks", + "type": "timeseries", + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 71 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "mongodb_mongos_sharding_chunks_total{cluster=\"$cluster\"}", + "legendFormat": "chunks", + "range": true, + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "description": "mongos 视角下的分片集群总 chunk 数。" } ], "refresh": "30s", @@ -1335,21 +2302,21 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(mongodb_ss_uptime,cluster)", + "definition": "label_values(mongodb_up,cluster)", "query": { - "query": "label_values(mongodb_ss_uptime,cluster)", + "query": "label_values(mongodb_up,cluster)", "refId": "StandardVariableQuery" }, "regex": "", - "sort": 0 + "sort": 1 }, { "current": {}, "hide": 0, - "includeAll": false, - "label": "cl_role", - "multi": false, - "name": "cl_role", + "includeAll": true, + "label": "topology", + "multi": true, + "name": "topology", "options": [], "refresh": 2, "skipUrlSync": false, @@ -1358,20 +2325,43 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\"}, cl_role)", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\"}, topology)", "query": { - "query": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\"}, cl_role)", + "query": "label_values(mongodb_up{cluster=~\"$cluster\"}, topology)", "refId": "StandardVariableQuery" }, "regex": "", - "sort": 0 + "sort": 1 }, { "current": {}, "hide": 0, - "includeAll": false, + "includeAll": true, + "label": "component", + "multi": true, + "name": "component", + "options": [], + "refresh": 2, + "skipUrlSync": false, + "type": "query", + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\"}, component)", + "query": { + "query": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\"}, component)", + "refId": "StandardVariableQuery" + }, + "regex": "", + "sort": 1 + }, + { + "current": {}, + "hide": 0, + "includeAll": true, "label": "instance", - "multi": false, + "multi": true, "name": "instance", "options": [], "refresh": 2, @@ -1381,13 +2371,13 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\", cl_role=~\"$cl_role\"}, instance)", + "definition": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\", component=~\"$component\"}, instance)", "query": { - "query": "label_values(mongodb_ss_uptime{cluster=~\"$cluster\", ident=~\"n9ecollector\", cl_role=~\"$cl_role\"}, instance)", + "query": "label_values(mongodb_up{cluster=~\"$cluster\", topology=~\"$topology\", component=~\"$component\"}, instance)", "refId": "StandardVariableQuery" }, "regex": "", - "sort": 0 + "sort": 1 } ] },