{
    "name": "Redis",
    "tags": "",
    "ident": "",
    "configs": {
        "version": "3.0.0",
        "links": [],
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "definition": "prometheus"
            },
            {
                "type": "query",
                "name": "instance",
                "definition": "label_values(redis_up, instance)",
                "allValue": null,
                "allOption": false,
                "multi": false,
                "reg": "",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                }
            }
        ],
        "panels": [
            {
                "id": "0eed8109-793a-4166-80cc-51cf473131cb",
                "type": "row",
                "name": "Basic Info",
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 0,
                    "i": "0eed8109-793a-4166-80cc-51cf473131cb",
                    "isResizable": false
                },
                "collapsed": true,
                "panels": []
            },
            {
                "type": "stat",
                "id": "64df416f-2e52-48f9-a078-fe614f1f8147",
                "layout": {
                    "h": 3,
                    "w": 5,
                    "x": 0,
                    "y": 1,
                    "i": "64df416f-2e52-48f9-a078-fe614f1f8147",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "expr": "min(redis_uptime_in_seconds{instance=~\"$instance\"})"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Redis Uptime",
                "custom": {
                    "textMode": "value",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 1,
                    "textSize": {}
                },
                "options": {
                    "standardOptions": {
                        "util": "humantimeSeconds"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "stat",
                "id": "99967138-c9b2-4d99-83fa-a45f19dcc6e9",
                "layout": {
                    "h": 3,
                    "w": 5,
                    "x": 5,
                    "y": 1,
                    "i": "99967138-c9b2-4d99-83fa-a45f19dcc6e9",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "expr": "redis_used_memory{instance=~\"$instance\"}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Memory Used",
                "custom": {
                    "textMode": "value",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 1,
                    "textSize": {}
                },
                "options": {
                    "valueMappings": [
                        {
                            "type": "range",
                            "match": {
                                "to": 128000000
                            },
                            "result": {
                                "color": "#079e05"
                            }
                        },
                        {
                            "type": "range",
                            "match": {
                                "from": 128000000
                            },
                            "result": {
                                "color": "#f10909"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "bytesIEC",
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "rate(redis_total_commands_processed{instance=~\"$instance\"}[5m])"
                    }
                ],
                "name": "Commands Executed / sec",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 6,
                    "w": 14,
                    "x": 10,
                    "y": 1,
                    "i": "fc170721-e193-4ca2-8ec8-e6cd877871d4",
                    "isResizable": true
                },
                "id": "390fa9cd-98fa-4bd6-a925-95eae17b1227",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "type": "stat",
                "id": "e39235e6-5158-4fd2-9f12-e40fe12c7fa0",
                "layout": {
                    "h": 3,
                    "w": 5,
                    "x": 0,
                    "y": 4,
                    "i": "e39235e6-5158-4fd2-9f12-e40fe12c7fa0",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "expr": "sum(redis_connected_clients{instance=~\"$instance\"})"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Connected Clients",
                "custom": {
                    "textMode": "value",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 1,
                    "textSize": {}
                },
                "options": {
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "stat",
                "id": "d0b964a7-2f45-4c25-8e5b-5d2e7d3c20ce",
                "layout": {
                    "h": 3,
                    "w": 5,
                    "x": 5,
                    "y": 4,
                    "i": "d0b964a7-2f45-4c25-8e5b-5d2e7d3c20ce",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "expr": "redis_maxmemory{instance=~\"$instance\"}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Max Memory Limit",
                "custom": {
                    "textMode": "value",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 1,
                    "textSize": {}
                },
                "options": {
                    "standardOptions": {
                        "util": "bytesIEC"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "gauge",
                "id": "d8e38e1c-f453-411b-bd13-39c8480ed147",
                "layout": {
                    "h": 6,
                    "w": 5,
                    "x": 0,
                    "y": 7,
                    "i": "d8e38e1c-f453-411b-bd13-39c8480ed147",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "rate(redis_used_cpu_sys{instance=~\"$instance\"}[5m])  * 100",
                        "legend": ""
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Redis CPU Usage",
                "links": [],
                "custom": {
                    "textMode": "value",
                    "calc": "lastNotNull"
                },
                "options": {
                    "standardOptions": {
                        "util": "percent",
                        "decimals": 2
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#3FC453",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#FF9919",
                                "value": 60
                            },
                            {
                                "color": "#FF656B",
                                "value": 80
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "gauge",
                "id": "2760c32e-4862-4867-b9d2-68d6c4407709",
                "layout": {
                    "h": 6,
                    "w": 5,
                    "x": 5,
                    "y": 7,
                    "i": "2760c32e-4862-4867-b9d2-68d6c4407709",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "100 * (redis_used_memory{instance=~\"$instance\"}  / redis_maxmemory{instance=~\"$instance\"} )",
                        "legend": ""
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Redis Memory Usage",
                "links": [],
                "custom": {
                    "textMode": "value",
                    "calc": "lastNotNull"
                },
                "options": {
                    "standardOptions": {
                        "util": "percent",
                        "decimals": 2
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#3FC453",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#FF9919",
                                "value": 60
                            },
                            {
                                "color": "#FF656B",
                                "value": 80
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "9fa56521-5d95-45bf-a7b5-da88d1020724",
                "layout": {
                    "h": 6,
                    "w": 14,
                    "x": 10,
                    "y": 7,
                    "i": "9fa56521-5d95-45bf-a7b5-da88d1020724",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "irate(redis_keyspace_hits{instance=~\"$instance\"}[5m])",
                        "legend": "hits"
                    },
                    {
                        "refId": "B",
                        "expr": "irate(redis_keyspace_misses{instance=~\"$instance\"}[5m])",
                        "legend": "misses"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Hits / Misses per Sec",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "a7dbd4fe-d833-4cc4-8903-0badd9e84291",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 13,
                    "i": "a7dbd4fe-d833-4cc4-8903-0badd9e84291",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "redis_used_memory{instance=~\"$instance\"} ",
                        "legend": "used"
                    },
                    {
                        "refId": "B",
                        "expr": "redis_maxmemory{instance=~\"$instance\"} ",
                        "legend": "max"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Total Memory Usage",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {
                        "decimals": 2
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "50776cbf-1462-4c30-863e-f71bab31eb0b",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 12,
                    "y": 13,
                    "i": "50776cbf-1462-4c30-863e-f71bab31eb0b",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "rate(redis_total_net_input_bytes{instance=~\"$instance\"}[5m])",
                        "legend": "input"
                    },
                    {
                        "refId": "B",
                        "expr": "rate(redis_total_net_output_bytes{instance=~\"$instance\"}[5m])",
                        "legend": "output"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Network I/O",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {
                        "decimals": 2
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "topk(5, irate(redis_cmdstat_calls{instance=~\"$instance\"} [1m]))",
                        "legend": "{{command}}"
                    }
                ],
                "name": "Top Commands",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 19,
                    "i": "ba5b93e2-7181-4493-b3f2-64b3a70c6f89",
                    "isResizable": true
                },
                "id": "ba5b93e2-7181-4493-b3f2-64b3a70c6f89",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "4323784d-0186-474f-89a1-6d2ceb844134",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 12,
                    "y": 19,
                    "i": "4323784d-0186-474f-89a1-6d2ceb844134",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "topk(5, irate(redis_cmdstat_calls{instance=~\"$instance\"} [1m]))",
                        "legend": "{{ command }}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Command Calls / sec",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "sum (redis_keyspace_keys{instance=~\"$instance\"}) by (db)",
                        "legend": "{{db}}"
                    }
                ],
                "name": "Total Items per DB",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 7,
                    "w": 8,
                    "x": 0,
                    "y": 25,
                    "i": "7fe3ad8b-e667-46be-9b00-62123054989e",
                    "isResizable": true
                },
                "id": "7fe3ad8b-e667-46be-9b00-62123054989e",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "sum(rate(redis_expired_keys{instance=~\"$instance\"}[5m])) by (instance)",
                        "legend": "expired"
                    },
                    {
                        "expr": "sum(rate(redis_evicted_keys{instance=~\"$instance\"}[5m])) by (instance)",
                        "legend": "evicted"
                    }
                ],
                "name": "Expired / Evicted",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 7,
                    "w": 8,
                    "x": 8,
                    "y": 25,
                    "i": "73674df6-8e5e-437f-9c20-24f8e3757f9b",
                    "isResizable": true
                },
                "id": "73674df6-8e5e-437f-9c20-24f8e3757f9b",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "sum(redis_keyspace_keys{instance=~\"$instance\"}) - sum(redis_keyspace_expires{instance=~\"$instance\"}) ",
                        "legend": "not expiring"
                    },
                    {
                        "expr": "sum(redis_keyspace_expires{instance=~\"$instance\"}) ",
                        "legend": "expiring"
                    }
                ],
                "name": "Expiring vs Not-Expiring Keys",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "noraml"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 7,
                    "w": 8,
                    "x": 16,
                    "y": 25,
                    "i": "34b0513d-84ee-433d-ab5f-f78decc681e1",
                    "isResizable": true
                },
                "id": "34b0513d-84ee-433d-ab5f-f78decc681e1",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "2.0.0",
                "id": "58d825c3-a518-4a02-9ad8-548140a6aa1f",
                "type": "timeseries",
                "name": "Blocked Clients",
                "links": [],
                "layout": {
                    "h": 8,
                    "w": 24,
                    "x": 0,
                    "y": 32,
                    "i": "58d825c3-a518-4a02-9ad8-548140a6aa1f",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "redis_blocked_clients{instance=~\"$instance\"}",
                        "legend": "blocked client"
                    }
                ],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "version": "2.0.0",
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "targets": [
                    {
                        "expr": "sum(rate(redis_total_net_input_bytes{instance=~\"$instance\"}[5m]))",
                        "legend": "input"
                    },
                    {
                        "expr": "sum(rate(redis_total_net_output_bytes{instance=~\"$instance\"}[5m]))",
                        "legend": "output"
                    }
                ],
                "name": "Network I/O",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {
                        "util": "bytesIEC",
                        "decimals": 2
                    },
                    "thresholds": {}
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "fillOpacity": 0.5,
                    "stack": "off"
                },
                "version": "2.0.0",
                "type": "timeseries",
                "layout": {
                    "h": 7,
                    "w": 24,
                    "x": 0,
                    "y": 40,
                    "i": "ae6c0024-a01b-4187-8b96-ae03bc8a4dae",
                    "isResizable": true
                },
                "id": "ae6c0024-a01b-4187-8b96-ae03bc8a4dae",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            }
        ],
        "datasourceValue": "ztcloud-dg"
    }
}