{
    "name": "Consul",
    "tags": "",
    "ident": "",
    "configs": {
        "version": "3.0.0",
        "links": [],
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "definition": "prometheus"
            }
        ],
        "panels": [
            {
                "type": "timeseries",
                "id": "0daf6c10-2612-4da7-b1d8-69af6086e457",
                "layout": {
                    "h": 7,
                    "w": 6,
                    "x": 0,
                    "y": 0,
                    "i": "0daf6c10-2612-4da7-b1d8-69af6086e457",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "consul_catalog_services",
                        "legend": "{{instance}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Total Services",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "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": "390d675d-06fa-4662-990d-ac4fb8cbf6ca",
                "layout": {
                    "h": 7,
                    "w": 6,
                    "x": 6,
                    "y": 0,
                    "i": "390d675d-06fa-4662-990d-ac4fb8cbf6ca",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "consul_raft_peers",
                        "legend": "{{instance}} - peers"
                    },
                    {
                        "refId": "B",
                        "expr": "consul_raft_leader",
                        "legend": "{{instance}} - leader"
                    },
                    {
                        "refId": "C",
                        "expr": "consul_serf_lan_members",
                        "legend": "{{instance}} - serf_lan_members"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Consul Peers and Leaders",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "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": "0085623f-4161-4ac7-b123-fd7d6510bd15",
                "layout": {
                    "h": 13,
                    "w": 12,
                    "x": 12,
                    "y": 0,
                    "i": "0085623f-4161-4ac7-b123-fd7d6510bd15",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum by (service_name, status) (consul_health_service_status{status!=\"passing\"})",
                        "legend": "{{service_name}} - {{status}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Unhealthy Consul Services",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "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": "278b84b3-dac6-46fd-934f-3cd33caea084",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 7,
                    "i": "278b84b3-dac6-46fd-934f-3cd33caea084",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "consul_health_node_status{status!='passing'}",
                        "legend": "{{node}} - {{status}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Unhealthy Consul Nodes",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "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": "cec96208-3770-4562-8e09-2edacb25db24",
                "layout": {
                    "h": 11,
                    "w": 24,
                    "x": 0,
                    "y": 13,
                    "i": "cec96208-3770-4562-8e09-2edacb25db24",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum by (node,service_id,status) (consul_health_service_status)",
                        "legend": "{{node}} - {{service_id}} - {{status}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Consul Services and Checks",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "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": "barGauge",
                "id": "fcff42b4-b069-440d-9a25-12c26d4905ab",
                "layout": {
                    "h": 11,
                    "w": 24,
                    "x": 0,
                    "y": 24,
                    "i": "6926a4e3-d503-4d19-939e-97e390f6b3e2",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum by (node,service_id,status) (consul_health_service_status)",
                        "legend": "{{status}} - {{service_id}}  - {{node}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Consul Services and Checks",
                "links": [],
                "custom": {
                    "calc": "lastNotNull",
                    "baseColor": "#FF656B",
                    "serieWidth": 20,
                    "sortOrder": "desc"
                },
                "options": {
                    "standardOptions": {}
                },
                "datasourceValue": "${datasource}"
            }
        ],
        "datasourceValue": "ztcloud-dg"
    }
}