{
    "name": "Pulsar - JVM",
    "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": "job",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(jvm_memory_bytes_used{cluster=~\"$cluster\"},job)",
                "reg": "",
                "multi": false
            },
            {
                "name": "instance",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(jvm_memory_bytes_used{cluster=~\"$cluster\",job=~\"$job\"},instance)",
                "reg": "",
                "multi": true,
                "allOption": true,
                "allValue": null
            }
        ],
        "panels": [
            {
                "type": "timeseries",
                "id": "920bb721-6f6b-4eb2-8fc9-48a8b4d36fef",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 0,
                    "i": "39bc1122-be16-405e-ace9-270688ba853c",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${datasource}",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "irate(process_cpu_seconds_total{instance=~\"$instance\", cluster=~\"$cluster\", job=~\"$job\"}[30s]) * 10",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "CPU",
                "links": [],
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list",
                        "heightInPercentage": 30,
                        "placement": "bottom",
                        "behaviour": "showItem",
                        "selectMode": "single"
                    },
                    "standardOptions": {
                        "util": "percent"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "linear",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "opacity",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "showPoints": "none",
                    "pointSize": 5
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "7ac950bc-833f-4a5b-af13-224bf6cb8840",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 0,
                    "i": "a283dc48-67ee-45e4-a52f-7162982d7b69",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "jvm_memory_direct_bytes_used{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}",
                        "legend": "{{instance}} - Used"
                    },
                    {
                        "refId": "B",
                        "expr": "jvm_memory_direct_bytes_max{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}",
                        "legend": "{{instance}} - Max"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Direct Memory",
                "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.34,
                    "gradientMode": "opacity",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "d36e9c6b-ae21-45ff-96c1-57fe5f6c1af2",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 0,
                    "y": 8,
                    "i": "f28826d9-75e1-4aa5-a1c7-fdf3095cc0ad",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(jvm_memory_bytes_committed{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}) by (instance)",
                        "legend": "{{instance}} - Heap size"
                    },
                    {
                        "refId": "B",
                        "expr": "sum(jvm_memory_bytes_used{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}) by (instance)",
                        "legend": "{{instance}} - Used"
                    },
                    {
                        "refId": "C",
                        "expr": "sum(jvm_memory_bytes_max{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}) by (instance)",
                        "legend": "{{instance}} - Max"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Heap Memory",
                "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.14,
                    "gradientMode": "opacity",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "83155de2-4f1a-4f91-b78e-ca267e6d017d",
                "layout": {
                    "h": 8,
                    "w": 12,
                    "x": 12,
                    "y": 8,
                    "i": "3ef77f09-21bf-4e81-8c1a-235acb8ec11f",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "B",
                        "expr": "sum(increase(jvm_gc_collection_seconds_sum{instance=~\"$instance\",cluster=~\"$cluster\",job=~\"$job\"}[30s])) by (instance)",
                        "legend": "{{instance}} - Pause"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "GC Pauses",
                "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}"
            }
        ]
    }
}