{
    "name": "KAFKA",
    "tags": "",
    "ident": "",
    "configs": {
        "version": "3.0.0",
        "links": [
            {
                "title": "Update",
                "url": "https://grafana.com/orgs/starsliao/dashboards",
                "targetBlank": true
            },
            {
                "title": "GitHub",
                "url": "https://github.com/starsliao",
                "targetBlank": true
            }
        ],
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "hide": false,
                "definition": "prometheus",
                "defaultValue": 12
            },
            {
                "name": "job",
                "type": "query",
                "hide": false,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(kafka_brokers,job)",
                "reg": "",
                "multi": false
            },
            {
                "name": "name",
                "type": "query",
                "hide": false,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(kafka_brokers{job=~\"$job\"},name)",
                "reg": "",
                "multi": false
            },
            {
                "name": "consumer_group",
                "type": "query",
                "hide": false,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "query_result(count by (consumergroup)(kafka_consumergroup_members{job=\"$job\",name=~\"$name\",consumergroup!~\"__.*\"}))",
                "reg": "/.*consumergroup=\"(.*)\".*/",
                "multi": false
            },
            {
                "name": "topic",
                "type": "query",
                "hide": false,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(kafka_topic_partitions{job=\"$job\",name=~\"$name\",topic !~\"__.*\"},topic)",
                "reg": "",
                "multi": false
            },
            {
                "name": "consumergroup_hide",
                "type": "query",
                "hide": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(kafka_consumergroup_members{job=\"$job\", name=~\"$name\", topic!~\"__.*\", topic=~\"$topic\", consumergroup!~\"__.*\"},consumergroup)",
                "reg": "",
                "multi": false
            }
        ],
        "panels": [
            {
                "version": "3.0.0",
                "id": "19fd7e55-c4dd-4e20-8663-49edb60b4048",
                "type": "stat",
                "name": "Brokers",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 0,
                    "y": 0,
                    "i": "19fd7e55-c4dd-4e20-8663-49edb60b4048",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "kafka_brokers{job=\"$job\",name=\"$name\"}"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "5fc91ec4-64bb-4739-86fb-fa992ce29a61",
                "type": "stat",
                "name": "Topics",
                "description": "包括无消费组消费的Topic",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 2,
                    "y": 0,
                    "i": "5fc91ec4-64bb-4739-86fb-fa992ce29a61",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "count(kafka_topic_partitions{job=\"$job\",name=\"$name\",topic !~\"__.*\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#EAB839",
                                "value": 100
                            },
                            {
                                "color": "#F2495C",
                                "value": 200
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "a86690ef-7acc-401d-b5f2-d46ecfd26e18",
                "type": "stat",
                "name": "分区数",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 4,
                    "y": 0,
                    "i": "a86690ef-7acc-401d-b5f2-d46ecfd26e18",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum (kafka_topic_partitions{job=\"$job\",name=\"$name\",topic !~\"__.*\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#FF9830",
                                "value": 500
                            },
                            {
                                "color": "#F2495C",
                                "value": 1000
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "b5eae728-5148-4842-85a7-15f9b8620126",
                "type": "stat",
                "name": "消费组",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 6,
                    "y": 0,
                    "i": "b5eae728-5148-4842-85a7-15f9b8620126",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "count(kafka_consumergroup_members{job=\"$job\",name=\"$name\",consumergroup!~\"__.*\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#EAB839",
                                "value": 100
                            },
                            {
                                "color": "#F2495C",
                                "value": 200
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "70de193a-02ad-4519-a583-d2694bcb1a44",
                "type": "stat",
                "name": "消费者",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 8,
                    "y": 0,
                    "i": "70de193a-02ad-4519-a583-d2694bcb1a44",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(kafka_consumergroup_members{job=\"$job\",name=\"$name\",consumergroup!~\"__.*\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#EAB839",
                                "value": 1000
                            },
                            {
                                "color": "#F2495C",
                                "value": 2000
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "9996fc0d-5039-4ed8-b245-5e0f5ea0c608",
                "type": "stat",
                "name": "Replicas",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 2,
                    "x": 10,
                    "y": 0,
                    "i": "9996fc0d-5039-4ed8-b245-5e0f5ea0c608",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(kafka_topic_partition_replicas{job=\"$job\",name=\"$name\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "69761355-7426-49e3-a7cf-0677e9cb59dc",
                "type": "stat",
                "name": "In Sync Replicas",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 3,
                    "x": 12,
                    "y": 0,
                    "i": "69761355-7426-49e3-a7cf-0677e9cb59dc",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(kafka_topic_partition_in_sync_replica{job=\"$job\",name=\"$name\"})"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "version": "3.0.0",
                "id": "d5da1af9-af20-4850-a923-5c4300e8fa7f",
                "type": "stat",
                "name": "每秒总生产",
                "links": [],
                "layout": {
                    "h": 3,
                    "w": 3,
                    "x": 15,
                    "y": 0,
                    "i": "d5da1af9-af20-4850-a923-5c4300e8fa7f",
                    "isResizable": true
                },
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(irate(kafka_topic_partition_current_offset{job=\"$job\",name=\"$name\",topic !~ \"__.*\"}[3m]))"
                    }
                ],
                "options": {
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "thresholds": {
                        "mode": "absolute",
                        "style": "line",
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    },
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    }
                },
                "custom": {
                    "version": "3.0.0",
                    "textMode": "value",
                    "calc": "lastNotNull",
                    "colorMode": "value"
                },
                "maxPerRow": 4,
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}"
            },
            {
                "type": "stat",
                "id": "f6e72521-013d-4402-8ce0-7fcfc0e90ec7",
                "layout": {
                    "h": 3,
                    "w": 3,
                    "x": 18,
                    "y": 0,
                    "i": "f6e72521-013d-4402-8ce0-7fcfc0e90ec7",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(irate(kafka_consumergroup_current_offset{job=\"$job\",name=~'$name'}[3m]))",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "每秒总消费",
                "links": [],
                "maxPerRow": 4,
                "custom": {
                    "textMode": "value",
                    "graphMode": "none",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 0,
                    "textSize": {},
                    "orientation": "auto"
                },
                "options": {
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    },
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    }
                }
            },
            {
                "type": "stat",
                "id": "a6b86a64-5fa6-4999-932a-78655d6b6331",
                "layout": {
                    "h": 3,
                    "w": 3,
                    "x": 21,
                    "y": 0,
                    "i": "a6b86a64-5fa6-4999-932a-78655d6b6331",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(kafka_consumergroup_uncommitted_offsets_sum{job=\"$job\",name=\"$name\"})",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "当前总积压",
                "links": [],
                "maxPerRow": 4,
                "custom": {
                    "textMode": "value",
                    "graphMode": "none",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 0,
                    "textSize": {},
                    "orientation": "auto"
                },
                "options": {
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 10000
                            }
                        ]
                    },
                    "valueMappings": [
                        {
                            "options": {
                                "match": "null",
                                "result": {
                                    "text": "0"
                                }
                            },
                            "type": "special"
                        }
                    ],
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    }
                }
            },
            {
                "version": "3.0.0",
                "id": "bfc59c24-e4d2-4cde-a634-76e992c659d3",
                "type": "row",
                "name": "消费者与Topic",
                "collapsed": true,
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 3,
                    "i": "bfc59c24-e4d2-4cde-a634-76e992c659d3",
                    "isResizable": false
                },
                "panels": []
            },
            {
                "type": "table",
                "id": "b0e8b60f-ff0c-4bd2-98b7-a0bc85e58d9e",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 0,
                    "y": 4,
                    "i": "b0e8b60f-ff0c-4bd2-98b7-a0bc85e58d9e",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "kafka_consumergroup_current_offset{name=\"gateway\"}",
                        "legend": "{{topic}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "消费组(Topic表格)",
                "links": [],
                "description": "消费组对应topic的current_offset表格",
                "maxPerRow": 4,
                "custom": {
                    "showHeader": true,
                    "colorMode": "value",
                    "nowrap": true,
                    "tableLayout": "auto",
                    "calc": "lastNotNull",
                    "displayMode": "seriesToRows",
                    "linkMode": "appendLinkColumn"
                },
                "options": {
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "result": {
                                "color": "#000000",
                                "text": "double-backup-invalid"
                            },
                            "match": {
                                "textValue": "7c04bbafe670b3a5399a96057d52aac1"
                            }
                        },
                        {
                            "type": "textValue",
                            "result": {
                                "color": "#000000",
                                "text": "double-backup-failure"
                            },
                            "match": {
                                "textValue": "e30ad9d7c2040595c71ac1579618f0c3"
                            }
                        }
                    ],
                    "standardOptions": {}
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "fa85ed9b-77fe-48cd-90e7-805053d407d0",
                "layout": {
                    "h": 8,
                    "w": 16,
                    "x": 8,
                    "y": 4,
                    "i": "fa85ed9b-77fe-48cd-90e7-805053d407d0",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "kafka_consumergroup_uncommitted_offsets_sum{job=\"$job\",name=\"$name\",consumergroup=~\"$consumer_group\",consumergroup!~\"__.*\",topic!~\"__.*\"}",
                        "legend": "{{consumergroup}} (topic: {{topic}})",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "消费组积压>100（关联消费组，Topic）",
                "links": [],
                "description": "No data为无积压超过100的消费组。",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: 7c04bbafe670b3a5399a96057d52aac1)"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-invalid)"
                            }
                        },
                        {
                            "type": "textValue",
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-failure)"
                            },
                            "match": {
                                "textValue": "spring-boot-consumer (topic: e30ad9d7c2040595c71ac1579618f0c3)"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none",
                        "min": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "02c690bf-023c-4074-8f0a-2ac928375b0f",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 0,
                    "y": 12,
                    "i": "02c690bf-023c-4074-8f0a-2ac928375b0f",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "B",
                        "expr": "sum(irate(kafka_topic_partition_current_offset{job=\"$job\",name=\"$name\",topic !~ \"__.*\"}[3m])) by (topic)>0",
                        "legend": "{{topic}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Topic每秒生产（关联Topic）",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "aa59d67c2123f094d0d6798ffe651c4d"
                            },
                            "result": {
                                "text": "metrics"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "1bbf714a3364b0e2957183ddf72433e8"
                            },
                            "result": {
                                "text": "logging-primary-failure"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "0df79b7305c3aaf9aac5d023c756ca77"
                            },
                            "result": {
                                "text": "logging-primary-invalid"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "c06c7298da41505a39ac1eae0c248a73"
                            },
                            "result": {
                                "text": "logging-backup-failure"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "cbe8f701fdb0d7eb13b8c99961d5f2ad"
                            },
                            "result": {
                                "text": "logging-backup-invalid"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "e30ad9d7c2040595c71ac1579618f0c3"
                            },
                            "result": {
                                "text": "double-backup-failure"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "7c04bbafe670b3a5399a96057d52aac1"
                            },
                            "result": {
                                "text": "double-backup-invalid"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "82d66796e017a48d6998fa0950df06c3"
                            },
                            "result": {
                                "text": "dobule-primary-invalid"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "180cf6e49d2a5ac4fba565739f686cee"
                            },
                            "result": {
                                "text": "dobule-primary-failure"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "c5b62a81-9a32-4c37-82d3-95fda2866b11",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 8,
                    "y": 12,
                    "i": "c5b62a81-9a32-4c37-82d3-95fda2866b11",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(irate(kafka_consumergroup_current_offset{job=\"$job\",name=~'$name',consumergroup=~\"$consumer_group\",consumergroup!~\"__.*\",topic!~\"__.*\"}[3m])) by (consumergroup, topic)",
                        "legend": "{{consumergroup}} (topic: {{topic}})",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "消费组每秒消费（关联消费组，Topic）",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: 7c04bbafe670b3a5399a96057d52aac1)"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-invalid)"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: e30ad9d7c2040595c71ac1579618f0c3)"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-failure)"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "3a3d2f71-cec1-459e-89f4-0a408fe59c49",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 16,
                    "y": 12,
                    "i": "3a3d2f71-cec1-459e-89f4-0a408fe59c49",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "B",
                        "expr": "sum(irate(kafka_consumergroup_current_offset{job=\"$job\",name=~'$name',consumergroup!~\"__.*\",topic!~\"__.*\"}[3m])) by (topic) - sum(irate(kafka_topic_partition_current_offset{job=\"$job\",name=\"$name\",topic!~\"__.*\"}[3m])) by (topic) * count(kafka_consumergroup_current_offset_sum{job=\"$job\",name=\"$name\",consumergroup!~\"__.*\",topic!~\"__.*\"}) by(topic)",
                        "legend": "{{topic}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Topic维度：每秒被消费总数 - 每秒生产*消费组数(负值为该秒消费不足)",
                "links": [],
                "description": "在Topic维度展示每秒该Topic整体被消费的情况。",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "asc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "7c04bbafe670b3a5399a96057d52aac1"
                            },
                            "result": {
                                "text": "double-backup-invalid"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "e30ad9d7c2040595c71ac1579618f0c3"
                            },
                            "result": {
                                "text": "double-backup-failure"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#F2495C",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#73BF69",
                                "value": 0
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "244e6ebb-cbe8-499a-b138-aaf40b79c68a",
                "layout": {
                    "h": 6,
                    "w": 24,
                    "x": 0,
                    "y": 20,
                    "i": "244e6ebb-cbe8-499a-b138-aaf40b79c68a",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum by (topic,job,name)(kafka_topic_partition_current_offset{job=\"$job\",name=~\"$name\",topic !~\"__.*\"} - kafka_topic_partition_oldest_offset{job=\"$job\",name=~\"$name\",topic !~\"__.*\"}) unless count by (topic,job,name)(kafka_consumergroup_current_offset{job=\"$job\",name=~\"$name\",consumergroup!~\"__.*\",topic!~\"__.*\"}) ",
                        "legend": "{{topic}} 总消息数",
                        "maxDataPoints": 240
                    },
                    {
                        "refId": "B",
                        "expr": "sum by (topic,job,name)(irate(kafka_topic_partition_current_offset{job=\"$job\",name=\"$name\",topic !~ \"__.*\"}[3m])) unless count by (topic,job,name)(kafka_consumergroup_current_offset{job=\"$job\",name=~\"$name\",consumergroup!~\"__.*\",topic!~\"__.*\"}) ",
                        "legend": "{{topic}} 每秒生产",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "无消费组消费的Topic（持续出现的Topic需要关注）",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "180cf6e49d2a5ac4fba565739f686cee 总消息数"
                            },
                            "result": {
                                "text": "dobule-primary-failure 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "180cf6e49d2a5ac4fba565739f686cee 每秒生产"
                            },
                            "result": {
                                "text": "dobule-primary-failure 每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "82d66796e017a48d6998fa0950df06c3 总消息数"
                            },
                            "result": {
                                "text": "dobule-primary-invalid 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "82d66796e017a48d6998fa0950df06c3 每秒生产"
                            },
                            "result": {
                                "text": "dobule-primary-invalid  每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "cbe8f701fdb0d7eb13b8c99961d5f2ad 总消息数"
                            },
                            "result": {
                                "text": "logging-backup-invalid 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "cbe8f701fdb0d7eb13b8c99961d5f2ad 每秒生产"
                            },
                            "result": {
                                "text": "logging-backup-invalid 每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "c06c7298da41505a39ac1eae0c248a73 总消息数"
                            },
                            "result": {
                                "text": "logging-backup-failure 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "c06c7298da41505a39ac1eae0c248a73 每秒生产"
                            },
                            "result": {
                                "text": "logging-backup-failure 每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "0df79b7305c3aaf9aac5d023c756ca77 总消息数"
                            },
                            "result": {
                                "text": "logging-primary-invalid 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "0df79b7305c3aaf9aac5d023c756ca77 每秒生产"
                            },
                            "result": {
                                "text": "logging-primary-invalid 每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "1bbf714a3364b0e2957183ddf72433e8 总消息数"
                            },
                            "result": {
                                "text": "logging-primary-failure 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "1bbf714a3364b0e2957183ddf72433e8 每秒生产"
                            },
                            "result": {
                                "text": "logging-primary-failure 每秒生产"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "aa59d67c2123f094d0d6798ffe651c4d 总消息数"
                            },
                            "result": {
                                "text": "metrics 总消息数"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "aa59d67c2123f094d0d6798ffe651c4d 每秒生产"
                            },
                            "result": {
                                "text": "metrics 每秒生产"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none",
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "version": "3.0.0",
                "id": "c2103b8a-8408-41b3-95a3-178bcb7afdf6",
                "type": "row",
                "name": "分区维度【需指定消费组】",
                "collapsed": true,
                "layout": {
                    "h": 1,
                    "w": 24,
                    "x": 0,
                    "y": 26,
                    "i": "c2103b8a-8408-41b3-95a3-178bcb7afdf6",
                    "isResizable": false
                },
                "panels": []
            },
            {
                "type": "timeseries",
                "id": "418868f5-92c3-4a0f-a2b1-36917d3be0a1",
                "layout": {
                    "h": 10,
                    "w": 12,
                    "x": 0,
                    "y": 27,
                    "i": "418868f5-92c3-4a0f-a2b1-36917d3be0a1",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "kafka_consumergroup_uncommitted_offsets{job=\"$job\",name=\"$name\",consumergroup=\"$consumer_group\",consumergroup!~\"__.*\",topic!~\"__.*\"}",
                        "legend": "{{consumergroup}} (topic: {{topic}}) 分区:{{partition}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "消费组【$consumer_group】各分区【当前积压】",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: 7c04bbafe670b3a5399a96057d52aac1) 分区:0"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-invalid) 分区:0"
                            }
                        },
                        {
                            "type": "textValue",
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-failure) 分区:0"
                            },
                            "match": {
                                "textValue": "spring-boot-consumer (topic: e30ad9d7c2040595c71ac1579618f0c3) 分区:0"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none",
                        "min": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "03fa93e7-796e-4420-8d39-39579e6b5951",
                "layout": {
                    "h": 10,
                    "w": 12,
                    "x": 12,
                    "y": 27,
                    "i": "03fa93e7-796e-4420-8d39-39579e6b5951",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "irate(kafka_consumergroup_current_offset[3m])",
                        "legend": "{{consumergroup}} (topic: {{topic}}) 分区:{{partition}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "消费组【$consumer_group】各分区【每秒消费】",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "valueMappings": [
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: 7c04bbafe670b3a5399a96057d52aac1) 分区:0"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-invalid) 分区:0"
                            }
                        },
                        {
                            "type": "textValue",
                            "match": {
                                "textValue": "spring-boot-consumer (topic: e30ad9d7c2040595c71ac1579618f0c3) 分区:0"
                            },
                            "result": {
                                "text": "spring-boot-consumer (topic: double-backup-failure) 分区:0"
                            }
                        }
                    ],
                    "standardOptions": {
                        "util": "none"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#73BF69",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#F2495C",
                                "value": 80
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            }
        ]
    }
}