{
  "leansignal_demand_export": "1.0",
  "exported_at": "2026-07-17T00:00:00Z",
  "source_tenant": "leansignal-catalog",
  "catalog": {
    "slug": "google-cloud-monitoring-otel-demand-extended",
    "integration": "google-cloud-monitoring",
    "variant": "extended",
    "title": "Google Cloud Monitoring — Extended",
    "category": "Cloud",
    "dashboards": 1,
    "panels": 24,
    "alerts": 12,
    "docs_url": "https://docs.leansignal.io/integrations/google-cloud-monitoring/"
  },
  "demand": {
    "ref": "demand",
    "name": "Google Cloud Monitoring — Extended",
    "description": "Deep per-service diagnostics: VM packet rates and allocated cores, Cloud SQL disk usage against quota and replica lag, the load balancer response-class mix, Pub/Sub dead letters and expired acknowledgement deadlines, and bucket API errors by response code — plus the full alert set.",
    "dashboards": [
      {
        "ref": "dash-google-cloud-monitoring",
        "name": "Google Cloud Monitoring — Extended",
        "description": "Google Cloud Monitoring metrics for Compute Engine, Cloud SQL, Cloud Load Balancing, Pub/Sub, and Cloud Storage — CPU, disk headroom, 5xx rates, backend latency, subscription backlog, and bucket size.",
        "data": {
          "display": {
            "name": "Google Cloud Monitoring — Extended"
          },
          "panels": {
            "gce_cpu": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU utilization",
                  "description": "Fraction of the allocated CPU in use, as the hypervisor sees it — the first thing to check on a slow VM."
                },
                "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": "avg by (project_id, zone, instance_id) (compute_googleapis_com_instance_cpu_utilization{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{instance_id}} · {{zone}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gce_network": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Network in / out",
                  "description": "Bytes per second across the VM network interfaces."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_network_received_bytes_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · in"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_network_sent_bytes_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · out"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gce_disk_throughput": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk read / write",
                  "description": "Bytes per second read from and written to the VM disks."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_disk_read_bytes_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · read"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_disk_write_bytes_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · write"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gce_disk_ops": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk IOPS",
                  "description": "Disk operations per second — read against the IOPS limit of the disk type and size, which is what usually binds first."
                },
                "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 (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_disk_read_ops_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · read"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_disk_write_ops_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · write"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gce_packets": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Packets in / out",
                  "description": "Packet rate beside the byte rate — a high packet count at low throughput means many tiny requests."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "packets/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_network_received_packets_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · in"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, zone, instance_id) (rate(compute_googleapis_com_instance_network_sent_packets_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{instance_id}} · out"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gce_reserved_cores": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Allocated vCPUs",
                  "description": "vCPUs the machine type reserves — the denominator behind the utilization panel, and the number the bill follows."
                },
                "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": "max by (project_id, zone, instance_id) (compute_googleapis_com_instance_cpu_reserved_cores{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{instance_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_up": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Server up",
                  "description": "Whether the instance is serving. Anything below 1 is downtime — planned maintenance included."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "decimal"
                      },
                      "min": 0,
                      "max": 1
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "min by (project_id, database_id) (cloudsql_googleapis_com_database_up{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_cpu": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU utilization",
                  "description": "Fraction of the instance CPU in use."
                },
                "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": "avg by (project_id, database_id) (cloudsql_googleapis_com_database_cpu_utilization{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_disk": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk utilization",
                  "description": "A database that fills its disk stops accepting writes — watch the trend, not just the level. Automatic storage increase only buys time."
                },
                "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": "max by (project_id, database_id) (cloudsql_googleapis_com_database_disk_utilization{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_memory": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Memory utilization",
                  "description": "Fraction of instance memory in use — a steady climb ends in swapping and latency spikes."
                },
                "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": "max by (project_id, database_id) (cloudsql_googleapis_com_database_memory_utilization{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_connections": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Connections",
                  "description": "Open connections per instance — read against the instance’s max_connections, which scales with its memory."
                },
                "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": "max by (project_id, database_id) (cloudsql_googleapis_com_database_network_connections{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_disk_bytes": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk used vs quota",
                  "description": "The absolute numbers behind the utilization panel — useful when you need to size the next increase, not just spot the squeeze."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_disk_bytes_used{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}} · used"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_disk_quota{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}} · quota"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_replica_lag": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Replica lag",
                  "description": "How far a read replica trails its primary. Growing lag means reads are served stale data. Primaries emit nothing."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "seconds"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_replication_replica_lag{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{database_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "lb_requests": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Requests",
                  "description": "Requests per second handled per URL map."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "requests/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, url_map_name) (rate(loadbalancing_googleapis_com_https_request_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{url_map_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "lb_5xx": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "5xx responses",
                  "description": "Server-error responses per second — from your backends or from the load balancer when no backend is healthy."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "requests/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, url_map_name) (rate(loadbalancing_googleapis_com_https_request_count{project_id=~\"$instance\",response_code_class=\"500\"}[5m]))",
                          "seriesNameFormat": "{{url_map_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "lb_latency": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Backend latency (p95)",
                  "description": "Time from the load balancer sending the request to receiving the last byte of the backend response."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "milliseconds"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "histogram_quantile(0.95, sum by (project_id, url_map_name, le) (rate(loadbalancing_googleapis_com_https_backend_latencies_bucket{project_id=~\"$instance\"}[5m])))",
                          "seriesNameFormat": "{{url_map_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "lb_response_classes": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Responses by class",
                  "description": "The 2xx/3xx/4xx/5xx mix — a 4xx shift without a 5xx shift is usually a client or routing change, not an outage."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "requests/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, url_map_name, response_code_class) (rate(loadbalancing_googleapis_com_https_request_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{url_map_name}} · {{response_code_class}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "pubsub_oldest_message": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Oldest unacked message age",
                  "description": "Age of the oldest unacknowledged message — the single best signal that subscribers have stalled."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "seconds"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (project_id, subscription_id) (pubsub_googleapis_com_subscription_oldest_unacked_message_age{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{subscription_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "pubsub_backlog": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Undelivered messages",
                  "description": "Backlog depth — messages published but not yet acknowledged."
                },
                "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": "max by (project_id, subscription_id) (pubsub_googleapis_com_subscription_num_undelivered_messages{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{subscription_id}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "pubsub_throughput": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Sent / acknowledged messages",
                  "description": "Delivery and acknowledgement rate side by side — a widening gap is a growing backlog."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, subscription_id) (rate(pubsub_googleapis_com_subscription_sent_message_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{subscription_id}} · sent"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, subscription_id) (rate(pubsub_googleapis_com_subscription_ack_message_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{subscription_id}} · acked"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "pubsub_failures": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Dead letters and expired acks",
                  "description": "Messages that gave up, and messages whose acknowledgement deadline passed — both mean subscribers are failing or too slow."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "counts/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, subscription_id) (rate(pubsub_googleapis_com_subscription_dead_letter_message_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{subscription_id}} · dead-lettered"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, subscription_id) (rate(pubsub_googleapis_com_subscription_expired_ack_deadlines_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{subscription_id}} · expired acks"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gcs_bytes": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Bytes stored",
                  "description": "Bytes in the bucket. Google samples this about once a day, so the line is deliberately coarse."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "bytes"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (project_id, bucket_name) (storage_googleapis_com_storage_total_bytes{project_id=~\"$instance\"})",
                          "seriesNameFormat": "{{bucket_name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gcs_requests": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "API requests by method",
                  "description": "Requests per second against the bucket, split by method — the number the operations bill is computed from."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "requests/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, bucket_name, method) (rate(storage_googleapis_com_api_request_count{project_id=~\"$instance\"}[5m]))",
                          "seriesNameFormat": "{{bucket_name}} · {{method}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "gcs_errors": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Failed API requests",
                  "description": "Every response code other than OK, kept separate so a burst of PERMISSION_DENIED never hides behind a burst of NOT_FOUND."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "requests/sec"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (project_id, bucket_name, response_code) (rate(storage_googleapis_com_api_request_count{project_id=~\"$instance\",response_code!=\"OK\"}[5m]))",
                          "seriesNameFormat": "{{bucket_name}} · {{response_code}}"
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "layouts": [
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Compute Engine",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_cpu"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_network"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_disk_throughput"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_disk_ops"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_packets"
                    }
                  },
                  {
                    "x": 12,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gce_reserved_cores"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Cloud SQL",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_up"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_cpu"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_disk"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_memory"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_connections"
                    }
                  },
                  {
                    "x": 12,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_disk_bytes"
                    }
                  },
                  {
                    "x": 0,
                    "y": 24,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_replica_lag"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Load Balancing",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/lb_requests"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/lb_5xx"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/lb_latency"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/lb_response_classes"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Pub/Sub",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/pubsub_oldest_message"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/pubsub_backlog"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/pubsub_throughput"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/pubsub_failures"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Cloud Storage",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gcs_bytes"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gcs_requests"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/gcs_errors"
                    }
                  }
                ]
              }
            }
          ],
          "variables": [
            {
              "kind": "ListVariable",
              "spec": {
                "name": "instance",
                "display": {
                  "name": "Instance"
                },
                "allowAllValue": true,
                "allowMultiple": true,
                "customAllValue": ".*",
                "defaultValue": ".*",
                "plugin": {
                  "kind": "PrometheusLabelValuesVariable",
                  "spec": {
                    "labelName": "project_id"
                  }
                }
              }
            }
          ],
          "duration": "1h",
          "refreshInterval": "30s",
          "datasources": {}
        }
      }
    ],
    "alert_rules": [
      {
        "ref": "alert-gcp-lb-high-5xx-ratio",
        "name": "Load balancer high 5xx ratio",
        "description": "A large share of requests through a load balancer are getting 5xx responses, so users are seeing errors.",
        "query": "sum by (project_id, url_map_name) (rate(loadbalancing_googleapis_com_https_request_count{response_code_class=\"500\"}[5m])) / clamp_min(sum by (project_id, url_map_name) (rate(loadbalancing_googleapis_com_https_request_count[5m])), 0.001)",
        "condition_op": "gt",
        "threshold": 0.05,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "Load balancer {{labels.url_map_name}} ({{labels.project_id}}) is serving {{value | percent:1}} 5xx responses.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-cloudsql-down",
        "name": "Cloud SQL instance down",
        "description": "A Cloud SQL instance is not serving, so every application that depends on it is failing.",
        "query": "min by (project_id, database_id) (cloudsql_googleapis_com_database_up)",
        "condition_op": "lt",
        "threshold": 1,
        "interval": "1m",
        "for": "10m",
        "severity": "critical",
        "message": "Cloud SQL instance {{labels.database_id}} ({{labels.project_id}}) is not serving.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-cloudsql-disk-nearly-full",
        "name": "Cloud SQL disk nearly full",
        "description": "A Cloud SQL instance is close to filling its disk; it stops accepting writes when it does.",
        "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_disk_utilization)",
        "condition_op": "gt",
        "threshold": 0.9,
        "interval": "1m",
        "for": "15m",
        "severity": "critical",
        "message": "Cloud SQL instance {{labels.database_id}} ({{labels.project_id}}) is {{value | percent:1}} full — it stops accepting writes when the disk fills.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-pubsub-backlog-age",
        "name": "Pub/Sub backlog aging",
        "description": "Messages are sitting unacknowledged in a subscription, meaning subscribers are stalled or falling behind.",
        "query": "max by (project_id, subscription_id) (pubsub_googleapis_com_subscription_oldest_unacked_message_age)",
        "condition_op": "gt",
        "threshold": 600,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "Subscription {{labels.subscription_id}} ({{labels.project_id}}) holds messages {{value}}s old — subscribers are stalled or falling behind.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-pubsub-backlog-size",
        "name": "Pub/Sub backlog growing",
        "description": "A subscription has built up a large backlog of undelivered messages, so subscribers are not keeping up.",
        "query": "max by (project_id, subscription_id) (pubsub_googleapis_com_subscription_num_undelivered_messages)",
        "condition_op": "gt",
        "threshold": 1000,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Subscription {{labels.subscription_id}} ({{labels.project_id}}) has {{value}} undelivered messages.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-gce-high-cpu",
        "name": "Compute Engine high CPU",
        "description": "A Compute Engine VM has been running at sustained high CPU, leaving no headroom for load spikes.",
        "query": "avg by (project_id, zone, instance_id) (compute_googleapis_com_instance_cpu_utilization)",
        "condition_op": "gt",
        "threshold": 0.9,
        "interval": "1m",
        "for": "30m",
        "severity": "warning",
        "message": "VM {{labels.instance_id}} ({{labels.zone}}) has averaged {{value | percent:1}} CPU for 30 minutes.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-cloudsql-high-cpu",
        "name": "Cloud SQL high CPU",
        "description": "A Cloud SQL instance is running at sustained high CPU, which degrades query latency.",
        "query": "avg by (project_id, database_id) (cloudsql_googleapis_com_database_cpu_utilization)",
        "condition_op": "gt",
        "threshold": 0.9,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Cloud SQL instance {{labels.database_id}} ({{labels.project_id}}) is at {{value | percent:1}} CPU.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-cloudsql-high-memory",
        "name": "Cloud SQL high memory",
        "description": "A Cloud SQL instance is nearly out of memory, so swapping and latency spikes come next.",
        "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_memory_utilization)",
        "condition_op": "gt",
        "threshold": 0.9,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Cloud SQL instance {{labels.database_id}} ({{labels.project_id}}) is using {{value | percent:1}} of its memory — swapping and latency spikes come next.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-lb-high-backend-latency",
        "name": "Load balancer slow backends",
        "description": "Load balancer backends are responding slowly at the 95th percentile, so users are waiting.",
        "query": "histogram_quantile(0.95, sum by (project_id, url_map_name, le) (rate(loadbalancing_googleapis_com_https_backend_latencies_bucket[5m])))",
        "condition_op": "gt",
        "threshold": 2000,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Load balancer {{labels.url_map_name}} ({{labels.project_id}}) has a p95 backend latency of {{value}}ms.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-cloudsql-replica-lag",
        "name": "Cloud SQL replica lag",
        "description": "A Cloud SQL replica is falling behind its primary, so reads from it return stale data.",
        "query": "max by (project_id, database_id) (cloudsql_googleapis_com_database_replication_replica_lag)",
        "condition_op": "gt",
        "threshold": 60,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Replica {{labels.database_id}} ({{labels.project_id}}) is {{value}}s behind its primary — reads are stale by that much.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-pubsub-expired-acks",
        "name": "Pub/Sub expired acknowledgements",
        "description": "Subscribers keep letting acknowledgement deadlines expire, so messages are redelivered instead of completed.",
        "query": "sum by (project_id, subscription_id) (rate(pubsub_googleapis_com_subscription_expired_ack_deadlines_count[5m]))",
        "condition_op": "gt",
        "threshold": 0,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Subscription {{labels.subscription_id}} ({{labels.project_id}}) is letting acknowledgement deadlines expire — subscribers are too slow, so messages are redelivered.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-gcp-gcs-request-errors",
        "name": "Cloud Storage request errors",
        "description": "API requests against a bucket keep failing, pointing at permissions, missing objects, or client bugs.",
        "query": "sum by (project_id, bucket_name) (rate(storage_googleapis_com_api_request_count{response_code!=\"OK\"}[5m]))",
        "condition_op": "gt",
        "threshold": 0.1,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Bucket {{labels.bucket_name}} ({{labels.project_id}}) is failing {{value}} requests per second.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      }
    ]
  }
}
