{
    "name": "Pulsar - Topic",
    "tags": "",
    "ident": "",
    "configs": {
        "version": "3.0.0",
        "links": [],
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "definition": "prometheus"
            },
            {
                "name": "cluster",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(up{job=\"pulsar-bookie\", cluster=~\"pulsar-.*\"},cluster)",
                "reg": "",
                "multi": false
            },
            {
                "name": "namespace",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(pulsar_topics_count{cluster=~\"$cluster\"},namespace)",
                "reg": "",
                "multi": false
            },
            {
                "name": "topic",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(pulsar_consumers_count{cluster=~\"$cluster\",namespace=~\"$namespace\"},topic)",
                "reg": "",
                "multi": false
            }
        ],
        "panels": [
            {
                "type": "timeseries",
                "id": "aab931e0-d355-4127-a724-52917293da47",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 0,
                    "y": 0,
                    "i": "aab931e0-d355-4127-a724-52917293da47",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "pulsar_rate_in{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}",
                        "legend": "{{cluster}} - {{namespace}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Local publish rate",
                "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": "896b7f91-a34a-4c7c-b6f2-fb46b6fed348",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 12,
                    "y": 0,
                    "i": "896b7f91-a34a-4c7c-b6f2-fb46b6fed348",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "pulsar_subscription_msg_rate_out{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}",
                        "legend": "{{subscription}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Local delivery rate",
                "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": "92769ab6-ef4e-4f90-91bd-f7d23b1de1df",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 0,
                    "y": 7,
                    "i": "92769ab6-ef4e-4f90-91bd-f7d23b1de1df",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "pulsar_throughput_in{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}",
                        "legend": "{{cluster}} - {{namespace}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Local publish throughput (bytes/s)",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "bytesIEC"
                    },
                    "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": "21abe3a7-b7fa-411e-9438-edba723e5bb0",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 12,
                    "y": 7,
                    "i": "21abe3a7-b7fa-411e-9438-edba723e5bb0",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "pulsar_subscription_msg_throughput_out{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}",
                        "legend": "{{subscription}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Local delivery throughput (bytes/s)",
                "links": [],
                "description": "",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {
                        "util": "bytesIEC"
                    },
                    "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": "212b4d54-ab19-49be-be42-252f54c33dce",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 0,
                    "y": 14,
                    "i": "212b4d54-ab19-49be-be42-252f54c33dce",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(pulsar_producers_count{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"})",
                        "legend": "producers"
                    },
                    {
                        "refId": "B",
                        "expr": "sum(pulsar_subscriptions_count{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"})",
                        "legend": "subscriptions"
                    },
                    {
                        "refId": "C",
                        "expr": "sum(pulsar_consumers_count{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"})",
                        "legend": "consumers"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Topics - Producers - Subscriptions - Consumers",
                "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": "c6bc1f72-f322-451b-8c29-ecf700aae7b5",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 12,
                    "y": 14,
                    "i": "c6bc1f72-f322-451b-8c29-ecf700aae7b5",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "pulsar_subscription_back_log{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}",
                        "legend": "{{subscription}} - {{instance}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Local backlog",
                "links": [],
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "table"
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "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": "6196567b-8ba6-40ae-b92d-a6620d73362f",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 0,
                    "y": 21,
                    "i": "6196567b-8ba6-40ae-b92d-a6620d73362f",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(pulsar_storage_write_latency_le_0_5{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "0 - 0.5 ms"
                    },
                    {
                        "refId": "B",
                        "expr": "sum(pulsar_storage_write_latency_le_1{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "0.5 - 1 ms"
                    },
                    {
                        "refId": "C",
                        "expr": "sum(pulsar_storage_write_latency_le_5{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "1 - 5 ms"
                    },
                    {
                        "refId": "D",
                        "expr": "sum(pulsar_storage_write_latency_le_10{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "5 - 10 ms"
                    },
                    {
                        "refId": "E",
                        "expr": "sum(pulsar_storage_write_latency_le_20{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "10 - 20 ms"
                    },
                    {
                        "refId": "F",
                        "expr": "sum(pulsar_storage_write_latency_le_50{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "20 - 50 ms"
                    },
                    {
                        "refId": "G",
                        "expr": "sum(pulsar_storage_write_latency_le_100{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "50 - 100 ms"
                    },
                    {
                        "refId": "H",
                        "expr": "sum(pulsar_storage_write_latency_le_200{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "100 - 200 ms"
                    },
                    {
                        "refId": "I",
                        "expr": "sum(pulsar_storage_write_latency_le_1000{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "200 ms - 1 s"
                    },
                    {
                        "refId": "J",
                        "expr": "sum(pulsar_storage_write_latency_overflow{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "> 1 s"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Storage Write Latency",
                "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": "92f617f2-396f-4f55-8718-079af28eb1b3",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 12,
                    "y": 21,
                    "i": "92f617f2-396f-4f55-8718-079af28eb1b3",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(pulsar_storage_size{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"})",
                        "legend": "",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Storage Size",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "standardOptions": {
                        "util": "bytesIEC",
                        "decimals": 1
                    },
                    "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"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "476dc642-fb7c-4cdf-a401-45a154894aed",
                "layout": {
                    "h": 7,
                    "w": 12,
                    "x": 0,
                    "y": 28,
                    "i": "476dc642-fb7c-4cdf-a401-45a154894aed",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(pulsar_entry_size_le_128{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 128 bytes"
                    },
                    {
                        "refId": "B",
                        "expr": "sum(pulsar_entry_size_le_512{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 512 bytes"
                    },
                    {
                        "refId": "C",
                        "expr": "sum(pulsar_entry_size_le_1_kb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 1 KB"
                    },
                    {
                        "refId": "D",
                        "expr": "sum(pulsar_entry_size_le_2_kb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 2 KB"
                    },
                    {
                        "refId": "E",
                        "expr": "sum(pulsar_entry_size_le_4_kb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 4 KB"
                    },
                    {
                        "refId": "F",
                        "expr": "sum(pulsar_entry_size_le_16_kb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 16 KB"
                    },
                    {
                        "refId": "G",
                        "expr": "sum(pulsar_entry_size_le_100_kb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 100 KB"
                    },
                    {
                        "refId": "H",
                        "expr": "sum(pulsar_entry_size_le_1_mb{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "< 1 MB"
                    },
                    {
                        "refId": "I",
                        "expr": "sum(pulsar_entry_size_overflow{cluster=~\"$cluster\", namespace=~\"$namespace\", topic=~\"$topic\"}) / 60.0",
                        "legend": "> 1 MB"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Storage entry size",
                "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}"
            }
        ],
        "graphTooltip": "default",
        "graphZoom": "default"
    }
}