赞
踩
在grafana官方没有找到好用的redis集群监控,自建一个,欢迎使用。
效果图:
说明:
1、支持查看整体和每个集群的慢日志、QPS、内存使用率、客户端连接数、不通操作QPS、集群整体健康状况、网络IO、总key,未设置失效时间key、内存碎片、缓存命中/未命中数等。
2、promethues里面每一个job_name代表一个redis culuster集群
3、使用方法:先在grafana里配置promethues源,然后import如下json model
- {
- "annotations": {
- "list": [ {
- "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": null, "graphTooltip": 0, "id": 12, "iteration": 1597660467403, "links": [], "panels": [ {
- "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "datasource": null, "description": "redis集群节点数", "fieldConfig": {
- "defaults": {
- "custom": {} }, "overrides": [] }, "format": "none", "gauge": {
- "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": {
- "h": 2, "w": 2, "x": 0, "y": 0 }, "id": 36, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ {
- "name": "value to text", "value": 1 }, {
- "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ {
- "from": "null", "text": "N/A", "to": "null" } ], "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, "ymax": null, "ymin": null }, "tableColumn": "", "targets": [ {
- "expr": "count(redis_instance_info{job=~\"$rediscluster\"})", "interval": "", "legendFormat": "", "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "redis集群节点数", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [ {
- "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, {
- "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "datasource": null, "description": "集群活跃节点数量", "fieldConfig": {
- "defaults": {
- "custom": {} }, "overrides": [] }, "format": "none", "gauge": {
- "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": {
- "h": 2, "w": 2, "x": 2, "y": 0 }, "id": 37, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ {
- "name": "value to text", "value": 1 }, {
- "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ {
- "from": "null", "text": "N/A", "to": "null" } ], "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, "ymax": null, "ymin": null }, "tableColumn": "", "targets": [ {
- "expr": "count(redis_up{job=~\"$rediscluster\"}>0)", "interval": "", "legendFormat": "", "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "集群活跃节点数", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [ {
- "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, {
- "cacheTimeout": null, "colorBackground": false, "colorValue": true, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "datasource": null, "description": "从节点数量", "fieldConfig": {
- "defaults": {
- "custom": {} }, "overrides": [] }, "format": "none", "gauge": {
- "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": {
- "h": 2, "w": 2, "x": 4, "y": 0 }, "id": 12, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ {
- "name": "value to text", "value": 1 }, {
- "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ {
- "from": "null", "text": "N/A", "to": "null" } ], "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, "ymax": null, "ymin": null }, "tableColumn": "", "targets": [ {
- "expr": "count(redis_instance_info{job=~\"$rediscluster\", role=\"slave\"})", "interval": "", "legendFormat": "", "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "从节点个数", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [ {
- "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, {
- "cacheTimeout": null, "colorBackground": false, "colorPrefix": false, "colorValue": true, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "datasource": null, "description": "主节点数量", "fieldConfig": {
- "defaults": {
- "custom": {} }, "overrides": [] }, "format": "none", "gauge": {
- "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": {
- "h": 2, "w": 2, "x": 6, "y": 0 }, "id": 10, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ {
- "name": "value to text", "value": 1 }, {
- "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ {
- "from": "null", "text": "N/A", "to": "null" } ], "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, "ymax": null, "ymin": null }, "tableColumn": "", "targets": [ {
- "expr": "count(redis_instance_info{job=~\"$rediscluster\", role=\"master\"})", "interval": "", "legendFormat": "", "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "主节点个数", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。