{
  "leansignal_demand_export": "1.0",
  "exported_at": "2026-07-17T00:00:00Z",
  "source_tenant": "leansignal-catalog",
  "catalog": {
    "slug": "mysql-otel-demand-essential",
    "integration": "mysql",
    "variant": "essential",
    "title": "MySQL — Essential",
    "category": "Database",
    "dashboards": 1,
    "panels": 4,
    "alerts": 3,
    "docs_url": "https://docs.leansignal.io/integrations/mysql/"
  },
  "demand": {
    "ref": "demand",
    "name": "MySQL — Essential (OpenTelemetry)",
    "description": "The database golden signals for MySQL/InnoDB — connections, row throughput, and buffer-pool efficiency — enough to know the server is healthy and serving queries.",
    "dashboards": [
      {
        "ref": "dash-mysql",
        "name": "MySQL — Essential",
        "description": "MySQL/InnoDB server metrics from the OpenTelemetry mysqlreceiver — buffer pool, threads, row/handler throughput, locks, and (opt-in) slow queries and replication (essential variant).",
        "data": {
          "display": {
            "name": "MySQL — Essential"
          },
          "panels": {
            "connected_threads": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Connected threads",
                  "description": "Open client connections — compare against your max_connections setting."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "decimal"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (mysql_instance_endpoint) (mysql_threads{mysql_instance_endpoint=~\"$instance\",kind=\"connected\"})",
                          "seriesNameFormat": "{{mysql_instance_endpoint}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "row_operations_rate": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Row operations",
                  "description": "Rows read/inserted/updated/deleted per second."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "ops/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (mysql_instance_endpoint, operation) (rate(mysql_row_operations_total{mysql_instance_endpoint=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{mysql_instance_endpoint}} · {{operation}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "buffer_pool_hit_ratio": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "InnoDB buffer pool hit ratio",
                  "description": "Reads served from memory — below ~95% the pool is likely undersized."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent-decimal"
                      },
                      "min": 0,
                      "max": 1
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "1 - (sum by (mysql_instance_endpoint) (rate(mysql_buffer_pool_operations_total{mysql_instance_endpoint=~\"$instance\",operation=\"reads\"}[5m])) / sum by (mysql_instance_endpoint) (rate(mysql_buffer_pool_operations_total{mysql_instance_endpoint=~\"$instance\",operation=\"read_requests\"}[5m])))",
                          "seriesNameFormat": "{{mysql_instance_endpoint}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "buffer_pool_utilization": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Buffer pool utilization",
                  "description": "Buffer pool bytes in use vs its configured size."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent-decimal"
                      },
                      "min": 0,
                      "max": 1
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (mysql_instance_endpoint) (mysql_buffer_pool_usage_bytes{mysql_instance_endpoint=~\"$instance\"}) / sum by (mysql_instance_endpoint) (mysql_buffer_pool_limit_bytes{mysql_instance_endpoint=~\"$instance\"})",
                          "seriesNameFormat": "{{mysql_instance_endpoint}}"
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "layouts": [
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Connections",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/connected_threads"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Throughput",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/row_operations_rate"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Buffer Pool",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/buffer_pool_hit_ratio"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/buffer_pool_utilization"
                    }
                  }
                ]
              }
            }
          ],
          "variables": [
            {
              "kind": "ListVariable",
              "spec": {
                "name": "instance",
                "display": {
                  "name": "Instance"
                },
                "allowAllValue": true,
                "allowMultiple": true,
                "customAllValue": ".*",
                "defaultValue": ".*",
                "plugin": {
                  "kind": "PrometheusLabelValuesVariable",
                  "spec": {
                    "labelName": "mysql_instance_endpoint"
                  }
                }
              }
            }
          ],
          "duration": "1h",
          "refreshInterval": "30s",
          "datasources": {}
        }
      }
    ],
    "alert_rules": [
      {
        "ref": "alert-mysql-instance-restarted",
        "name": "MySQL instance restarted",
        "description": null,
        "query": "mysql_uptime_seconds_total",
        "condition_op": "lt",
        "threshold": 300,
        "interval": "1m",
        "for": "1m",
        "severity": "warning",
        "message": "MySQL {{labels.mysql_instance_endpoint}} uptime is {{value}}s — the server likely restarted in the last 5 minutes.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-mysql-high-connections",
        "name": "MySQL high connection count",
        "description": null,
        "query": "sum by (mysql_instance_endpoint) (mysql_threads{kind=\"connected\"})",
        "condition_op": "gt",
        "threshold": 100,
        "interval": "1m",
        "for": "5m",
        "severity": "warning",
        "message": "MySQL {{labels.mysql_instance_endpoint}} has {{value}} connected threads — tune this threshold to ~80% of max_connections.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-mysql-low-buffer-pool-hit-ratio",
        "name": "MySQL low buffer pool hit ratio",
        "description": null,
        "query": "1 - (sum by (mysql_instance_endpoint) (rate(mysql_buffer_pool_operations_total{operation=\"reads\"}[5m])) / sum by (mysql_instance_endpoint) (rate(mysql_buffer_pool_operations_total{operation=\"read_requests\"}[5m])))",
        "condition_op": "lt",
        "threshold": 0.95,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "InnoDB buffer pool hit ratio on {{labels.mysql_instance_endpoint}} is {{value}} — the pool may be undersized.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      }
    ]
  }
}
