grafana模板_redis集群监控grafana模板分享(数据源promethues)

本文分享了一个自定义的Grafana模板,用于高效监控Redis集群的慢日志、QPS、内存使用等关键指标。通过Prometheus数据源,用户可以轻松导入模板并监控多个Redis集群的健康状况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在grafana官方没有找到好用的redis集群监控,自建一个,欢迎使用。

效果图:

d21be32790290895b29e20b63f0d4dba.png

43d09ec4564632db754cc1f308d6fb83.png

66ca490dea8cc5fdc4186d75123eda5d.png

b7cbdc35f27246c2a7bac86bd182b90e.png

说明:

1、支持查看整体和每个集群的慢日志、QPS、内存使用率、客户端连接数、不通操作QPS、集群整体健康状况、网络IO、总key,未设置失效时间key、内存碎片、缓存命中/未命中数等。

2、promethues里面每一个job_name代表一个redis culuster集群

3、使用方法:先在grafana里配置promethues源,然后import如下json model

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": [    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值