{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "Prometheus datasource for cassandra-on-mysql proxy metrics",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.4.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": "10.4.0"
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": "10.4.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Prometheus dashboard for cassandra-on-mysql proxy request, CQL, MySQL, pool, and index-selection metrics.",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 2,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 500
              },
              {
                "color": "red",
                "value": 2000
              }
            ]
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "sum(rate(proxy_request_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "requests/s",
          "refId": "A"
        }
      ],
      "title": "Requests / s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 2,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 1
              },
              {
                "color": "red",
                "value": 5
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 4,
        "y": 0
      },
      "id": 2,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "100 * sum(rate(proxy_request_completed_total{status=\"error\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])) / clamp_min(sum(rate(proxy_request_completed_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])), 0.001)",
          "legendFormat": "error %",
          "refId": "A"
        }
      ],
      "title": "Request Error %",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 2,
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 36
      },
      "id": 27,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "100 * sum by (op_type) (rate(proxy_request_completed_total{status=\"error\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])) / clamp_min(sum by (op_type) (rate(proxy_request_completed_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])), 0.001)",
          "legendFormat": "{{op_type}}",
          "refId": "A"
        }
      ],
      "title": "Request Error % by Op Type",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 3,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.1
              },
              {
                "color": "red",
                "value": 0.5
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 8,
        "y": 0
      },
      "id": 3,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.95, sum by (le) (rate(proxy_request_duration_seconds_bucket{status=\"ok\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p95",
          "refId": "A"
        }
      ],
      "title": "Request P95",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 100
              },
              {
                "color": "red",
                "value": 500
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 0
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "sum(proxy_request_in_flight{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "in-flight",
          "refId": "A"
        }
      ],
      "title": "In-flight Requests",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 4
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (opcode) (rate(proxy_request_total{opcode!~\"UNKNOWN_OP_.*\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{opcode}}",
          "refId": "A"
        }
      ],
      "title": "Request Throughput by Opcode",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 4
      },
      "id": 6,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.95, sum by (status, le) (rate(proxy_request_duration_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p95/{{status}}",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.99, sum by (status, le) (rate(proxy_request_duration_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p99/{{status}}",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.999, sum by (status, le) (rate(proxy_request_duration_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p999/{{status}}",
          "refId": "C"
        }
      ],
      "title": "Request Latency by Status (P95/P99/P999)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 12
      },
      "id": 7,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.95, sum by (stage, le) (rate(proxy_request_stage_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "{{stage}}",
          "refId": "A"
        }
      ],
      "title": "Stage P95 Duration",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 20
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum(rate(proxy_cql_query_total{query_type=\"select\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "SELECT",
          "refId": "A"
        },
        {
          "expr": "sum(rate(proxy_cql_query_total{query_type=\"insert\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "INSERT",
          "refId": "B"
        },
        {
          "expr": "sum(rate(proxy_cql_query_total{query_type=\"update\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "UPDATE",
          "refId": "C"
        },
        {
          "expr": "sum(rate(proxy_cql_query_total{query_type=\"batch\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "BATCH",
          "refId": "D"
        }
      ],
      "title": "CQL Main Query QPS",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "rows/s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 20
      },
      "id": 28,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (operation_type) (rate(proxy_cql_write_rows_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{operation_type}}",
          "refId": "A"
        }
      ],
      "title": "CQL Write Rows Rate",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 44
      },
      "id": 9,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.95, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"select\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "SELECT",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.95, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"insert\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "INSERT",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.95, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"update\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "UPDATE",
          "refId": "C"
        },
        {
          "expr": "histogram_quantile(0.95, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"batch\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "BATCH",
          "refId": "D"
        }
      ],
      "title": "CQL Main Query P95",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 52
      },
      "id": 10,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (operation, status) (rate(proxy_mysql_operation_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{operation}}/{{status}}",
          "refId": "A"
        }
      ],
      "title": "MySQL Operation Rate",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 44
      },
      "id": 11,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.95, sum by (operation, le) (rate(proxy_mysql_operation_seconds_bucket{status=\"ok\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "{{operation}}",
          "refId": "A"
        }
      ],
      "title": "MySQL Operation P95",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 52
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (operation, error_type) (rate(proxy_mysql_error_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{operation}}/{{error_type}}",
          "refId": "A"
        }
      ],
      "title": "MySQL Error Rate",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 52
      },
      "id": 13,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (tenant, user) (proxy_mysql_pool_open{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "open {{tenant}}/{{user}}",
          "refId": "A"
        },
        {
          "expr": "sum by (tenant, user) (proxy_mysql_pool_in_use{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "in_use {{tenant}}/{{user}}",
          "refId": "B"
        }
      ],
      "title": "MySQL Pool Connections",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "This is a cumulative snapshot exported from sql.DB stats; use it to spot resets, growth, and noisy tenants/users.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 60
      },
      "id": 14,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (tenant, user) (proxy_mysql_pool_wait_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "{{tenant}}/{{user}}",
          "refId": "A"
        }
      ],
      "title": "MySQL Pool Wait Count",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "This is a cumulative snapshot exported from sql.DB stats; sustained growth usually means the pool is undersized or backends are slow.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 2,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 60
      },
      "id": 15,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (tenant, user) (proxy_mysql_pool_wait_seconds_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "{{tenant}}/{{user}}",
          "refId": "A"
        }
      ],
      "title": "MySQL Pool Wait Seconds",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "Sampled at 1/100 in the planner to reduce write volume and label cardinality.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 68
      },
      "id": 16,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (outcome, rule, index_type) (rate(proxy_index_selection_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{outcome}}/{{rule}}/{{index_type}}",
          "refId": "A"
        }
      ],
      "title": "Index Selection Outcomes",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 76
      },
      "id": 23,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (tenant, user) (proxy_mysql_prepared_stmt_cache_size{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "{{tenant}}/{{user}}",
          "refId": "A"
        }
      ],
      "title": "Prepared Statement Cache Size",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 76
      },
      "id": 24,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum(rate(proxy_mysql_prepared_stmt_cache_hits_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "hits/s",
          "refId": "A"
        },
        {
          "expr": "sum(rate(proxy_mysql_prepared_stmt_cache_misses_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "misses/s",
          "refId": "B"
        },
        {
          "expr": "sum(rate(proxy_mysql_prepared_stmt_cache_evictions_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "evictions/s",
          "refId": "C"
        },
        {
          "expr": "sum(rate(proxy_mysql_prepared_stmt_cache_errors_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "errors/s",
          "refId": "D"
        }
      ],
      "title": "Prepared Statement Cache Activity",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 84
      },
      "id": 25,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (scope) (proxy_cql_connection_count{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"})",
          "legendFormat": "{{scope}}",
          "refId": "A"
        }
      ],
      "title": "Connection Count",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 70,
            "gradientMode": "none",
            "lineWidth": 1,
            "showPoints": "never"
          },
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 84
      },
      "id": 26,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "sum by (scope) (rate(proxy_cql_disconnection_total{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval]))",
          "legendFormat": "{{scope}}",
          "refId": "A"
        }
      ],
      "title": "Disconnection Count",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 3,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.1
              },
              {
                "color": "red",
                "value": 0.5
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 0
      },
      "id": 17,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(proxy_request_duration_seconds_bucket{status=\"ok\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p99",
          "refId": "A"
        }
      ],
      "title": "Request P99",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 3,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.1
              },
              {
                "color": "red",
                "value": 0.5
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 16,
        "y": 0
      },
      "id": 18,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.999, sum by (le) (rate(proxy_request_duration_seconds_bucket{status=\"ok\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "p999",
          "refId": "A"
        }
      ],
      "title": "Request P999",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 12
      },
      "id": 19,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.99, sum by (stage, le) (rate(proxy_request_stage_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "{{stage}}",
          "refId": "A"
        }
      ],
      "title": "Stage P99 Duration",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 12
      },
      "id": 20,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.999, sum by (stage, le) (rate(proxy_request_stage_seconds_bucket{KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "{{stage}}",
          "refId": "A"
        }
      ],
      "title": "Stage P999 Duration",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 36
      },
      "id": 21,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"select\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "SELECT",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"insert\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "INSERT",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"update\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "UPDATE",
          "refId": "C"
        },
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"batch\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "BATCH",
          "refId": "D"
        }
      ],
      "title": "CQL Main Query P99",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "decimals": 3,
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 36
      },
      "id": 22,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max"
          ],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "histogram_quantile(0.999, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"select\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "SELECT",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.999, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"insert\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "INSERT",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.999, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"update\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "UPDATE",
          "refId": "C"
        },
        {
          "expr": "histogram_quantile(0.999, sum by (le) (rate(proxy_cql_query_duration_seconds_bucket{status=\"ok\",query_type=\"batch\",KeyspaceName=~\"$KeyspaceName\",ClusterId=~\"$ClusterId\"}[$__rate_interval])))",
          "legendFormat": "BATCH",
          "refId": "D"
        }
      ],
      "title": "CQL Main Query P999",
      "type": "timeseries"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 39,
  "style": "dark",
  "tags": [
    "cassandra-on-mysql",
    "proxy",
    "prometheus"
  ],
  "templating": {
    "list": [
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(proxy_request_total, KeyspaceName)",
        "hide": 0,
        "includeAll": true,
        "label": "Keyspace",
        "multi": true,
        "name": "KeyspaceName",
        "options": [],
        "query": {
          "qryType": 1,
          "query": "label_values(proxy_request_total, KeyspaceName)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "sort": 1,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(proxy_request_total{KeyspaceName=~\"$KeyspaceName\"}, ClusterId)",
        "hide": 0,
        "includeAll": true,
        "label": "Cluster ID",
        "multi": true,
        "name": "ClusterId",
        "options": [],
        "query": {
          "qryType": 1,
          "query": "label_values(proxy_request_total{KeyspaceName=~\"$KeyspaceName\"}, ClusterId)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "sort": 1,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Cassandra-on-MySQL Proxy",
  "uid": "cassandra-on-mysql-proxy",
  "version": 4,
  "weekStart": ""
}