{
  "leansignal_demand_export": "1.0",
  "exported_at": "2026-07-17T00:00:00Z",
  "source_tenant": "leansignal-catalog",
  "catalog": {
    "slug": "azure-monitor-otel-demand-extended",
    "integration": "azure-monitor",
    "variant": "extended",
    "title": "Azure Monitor — Extended",
    "category": "Cloud",
    "dashboards": 1,
    "panels": 25,
    "alerts": 12,
    "docs_url": "https://docs.leansignal.io/integrations/azure-monitor/"
  },
  "demand": {
    "ref": "demand",
    "name": "Azure Monitor — Extended",
    "description": "Deep per-service diagnostics: B-series CPU credits and disk IOPS saturation, App Service CPU time, Azure SQL log-write and worker saturation, storage latency and ingress/egress, and Service Bus errors and throttling — plus the full alert set.",
    "dashboards": [
      {
        "ref": "dash-azure-monitor",
        "name": "Azure Monitor — Extended",
        "description": "Azure Monitor metrics for Virtual Machines, App Service, Azure SQL, Storage accounts, and Service Bus — CPU, memory, 5xx rates, storage headroom, availability, latency, and message backlogs.",
        "data": {
          "display": {
            "name": "Azure Monitor — Extended"
          },
          "panels": {
            "vm_cpu": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU utilization",
                  "description": "Per-VM CPU 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"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "avg by (resource_group, name) (azure_percentage_cpu_average{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "vm_available_memory": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Available memory",
                  "description": "Memory still free on the VM. A steady decline ends in paging, then in the OOM killer."
                },
                "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": "min by (resource_group, name) (azure_available_memory_bytes_average{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "vm_network_io": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Network in / out (per period)",
                  "description": "Bytes across the VM network interfaces per Azure Monitor period."
                },
                "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": "sum by (resource_group, name) (azure_network_in_total_total{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · in"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_network_out_total_total{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · out"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "vm_disk_io": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk read / write (per period)",
                  "description": "Bytes read from and written to the VM disks per period."
                },
                "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": "sum by (resource_group, name) (azure_disk_read_bytes_total{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · read"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_disk_write_bytes_total{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · write"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "vm_cpu_credits": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU credits remaining (B-series)",
                  "description": "Burstable VMs hard-throttle when this reaches zero — the classic \"VM suddenly slow\" cause. Non-B sizes emit nothing."
                },
                "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": "min by (resource_group, name) (azure_cpu_credits_remaining_average{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "vm_disk_iops_consumed": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Disk IOPS consumed",
                  "description": "How much of the disk IOPS budget is in use. Sustained 100% means the disk, not the workload, sets the pace."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_os_disk_iops_consumed_percentage_average{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · os disk"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_data_disk_iops_consumed_percentage_average{resource_group=~\"$instance\",type=\"Microsoft.Compute/virtualMachines\"})",
                          "seriesNameFormat": "{{name}} · data disk"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "app_requests": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Requests (per period)",
                  "description": "Requests served per app per Azure Monitor period."
                },
                "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 (resource_group, name) (azure_requests_total{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "app_errors": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "4xx / 5xx responses (per period)",
                  "description": "Client errors beside server errors — 5xx is yours to fix, a 4xx spike usually is not."
                },
                "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 (resource_group, name) (azure_http5xx_total{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}} · 5xx"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_http4xx_total{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}} · 4xx"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "app_response_time": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Response time (avg)",
                  "description": "Time to serve a request, averaged over the period."
                },
                "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 (resource_group, name) (azure_httpresponsetime_average{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "app_memory": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Memory working set",
                  "description": "Memory the app holds — read against your App Service plan size; apps are recycled when the plan runs out."
                },
                "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 (resource_group, name) (azure_memoryworkingset_average{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "app_cpu_time": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU time (per period)",
                  "description": "CPU seconds consumed per period — the metric the Free and Shared plan quotas are enforced on."
                },
                "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": "sum by (resource_group, name) (azure_cputime_total{resource_group=~\"$instance\",type=\"Microsoft.Web/sites\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_cpu": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "CPU utilization",
                  "description": "Per-database CPU against its service tier — this is a fraction of the tier, not of a machine."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "avg by (resource_group, name) (azure_cpu_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_storage": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Storage used",
                  "description": "A database that fills its allocated storage stops accepting writes — watch the trend, not just the level."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_storage_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_connections": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Connections (per period)",
                  "description": "Successful and failed logins side by side — a failed-login spike is a credential, firewall, or limit problem."
                },
                "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 (resource_group, name) (azure_connection_successful_total{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · successful"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_connection_failed_total{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · failed"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_deadlocks": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Deadlocks (per period)",
                  "description": "Deadlocked transactions the engine had to kill — nonzero means application queries are fighting each other."
                },
                "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 (resource_group, name) (azure_deadlock_total{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_io": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Data I/O and log write",
                  "description": "The two I/O budgets of the service tier. Log write pinned at 100% throttles every writer."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_physical_data_read_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · data I/O"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_log_write_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · log write"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sql_workers": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Workers and sessions",
                  "description": "Worker-thread and session limits of the tier — hitting either rejects new work while CPU still looks fine."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_workers_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · workers"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_sessions_percent_average{resource_group=~\"$instance\",type=\"Microsoft.Sql/servers/databases\"})",
                          "seriesNameFormat": "{{name}} · sessions"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "storage_availability": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Availability",
                  "description": "Share of requests the storage account served without a service-side error — the single best storage health signal."
                },
                "plugin": {
                  "kind": "TimeSeriesChart",
                  "spec": {
                    "legend": {
                      "position": "bottom",
                      "mode": "table",
                      "values": [
                        "last-number",
                        "mean",
                        "max"
                      ]
                    },
                    "yAxis": {
                      "format": {
                        "unit": "percent"
                      },
                      "min": 0,
                      "max": 100
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "min by (resource_group, name) (azure_availability_average{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "storage_transactions": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Transactions (per period)",
                  "description": "Requests against the account per period — the number the transaction bill is computed from."
                },
                "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 (resource_group, name) (azure_transactions_total{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "storage_capacity": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Used capacity",
                  "description": "Bytes stored in the account. Reported once or twice 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 (resource_group, name) (azure_usedcapacity_average{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}}"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "storage_latency": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "End-to-end / server latency",
                  "description": "Server latency is Azure’s time to process; end-to-end adds network and client time. A gap between them is a client-side problem."
                },
                "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": "max by (resource_group, name) (azure_successe2elatency_average{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}} · end-to-end"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "max by (resource_group, name) (azure_successserverlatency_average{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}} · server"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "storage_traffic": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Ingress / egress (per period)",
                  "description": "Bytes in and out of the account — egress is the line that shows up on the bandwidth bill."
                },
                "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": "sum by (resource_group, name) (azure_ingress_total{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}} · ingress"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_egress_total{resource_group=~\"$instance\",type=\"Microsoft.Storage/storageAccounts\"})",
                          "seriesNameFormat": "{{name}} · egress"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sb_backlog": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Active and dead-lettered messages",
                  "description": "Messages waiting to be received, and messages that gave up trying — a rising dead-letter count is a stuck consumer."
                },
                "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 (resource_group, name) (azure_activemessages_average{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · active"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_deadletteredmessages_average{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · dead-lettered"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sb_throughput": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Incoming / outgoing messages (per period)",
                  "description": "Producer and consumer throughput 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": "decimal"
                      },
                      "min": 0
                    }
                  }
                },
                "queries": [
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_incomingmessages_total{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · incoming"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_outgoingmessages_total{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · outgoing"
                        }
                      }
                    }
                  }
                ]
              }
            },
            "sb_errors": {
              "kind": "Panel",
              "spec": {
                "display": {
                  "name": "Errors and throttling (per period)",
                  "description": "Server errors are the namespace’s fault, user errors the client’s, throttled requests mean the tier’s quota is the limit."
                },
                "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 (resource_group, name) (azure_servererrors_total{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · server"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_usererrors_total{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · user"
                        }
                      }
                    }
                  },
                  {
                    "kind": "TimeSeriesQuery",
                    "spec": {
                      "plugin": {
                        "kind": "PrometheusTimeSeriesQuery",
                        "spec": {
                          "query": "sum by (resource_group, name) (azure_throttledrequests_total{resource_group=~\"$instance\",type=\"Microsoft.ServiceBus/namespaces\"})",
                          "seriesNameFormat": "{{name}} · throttled"
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "layouts": [
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Virtual Machines",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_cpu"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_available_memory"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_network_io"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_disk_io"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_cpu_credits"
                    }
                  },
                  {
                    "x": 12,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/vm_disk_iops_consumed"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "App Service",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/app_requests"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/app_errors"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/app_response_time"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/app_memory"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/app_cpu_time"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Azure SQL",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_cpu"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_storage"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_connections"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_deadlocks"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_io"
                    }
                  },
                  {
                    "x": 12,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sql_workers"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Storage",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/storage_availability"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/storage_transactions"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/storage_capacity"
                    }
                  },
                  {
                    "x": 12,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/storage_latency"
                    }
                  },
                  {
                    "x": 0,
                    "y": 16,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/storage_traffic"
                    }
                  }
                ]
              }
            },
            {
              "kind": "Grid",
              "spec": {
                "display": {
                  "title": "Service Bus",
                  "collapse": {
                    "open": true
                  }
                },
                "items": [
                  {
                    "x": 0,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sb_backlog"
                    }
                  },
                  {
                    "x": 12,
                    "y": 0,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sb_throughput"
                    }
                  },
                  {
                    "x": 0,
                    "y": 8,
                    "width": 12,
                    "height": 8,
                    "content": {
                      "$ref": "#/spec/panels/sb_errors"
                    }
                  }
                ]
              }
            }
          ],
          "variables": [
            {
              "kind": "ListVariable",
              "spec": {
                "name": "instance",
                "display": {
                  "name": "Instance"
                },
                "allowAllValue": true,
                "allowMultiple": true,
                "customAllValue": ".*",
                "defaultValue": ".*",
                "plugin": {
                  "kind": "PrometheusLabelValuesVariable",
                  "spec": {
                    "labelName": "resource_group"
                  }
                }
              }
            }
          ],
          "duration": "1h",
          "refreshInterval": "30s",
          "datasources": {}
        }
      }
    ],
    "alert_rules": [
      {
        "ref": "alert-azure-app-high-5xx-ratio",
        "name": "App Service high 5xx ratio",
        "description": "A large share of requests to an App Service app are getting 5xx responses, so users are seeing errors.",
        "query": "sum by (resource_group, name) (azure_http5xx_total{type=\"Microsoft.Web/sites\"}) / clamp_min(sum by (resource_group, name) (azure_requests_total{type=\"Microsoft.Web/sites\"}), 1)",
        "condition_op": "gt",
        "threshold": 0.05,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "App Service {{labels.name}} ({{labels.resource_group}}) is serving {{value | percent:1}} 5xx responses.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-sql-storage-high",
        "name": "Azure SQL storage nearly full",
        "description": "An Azure SQL database is close to its allocated storage; it stops accepting writes when full.",
        "query": "max by (resource_group, name) (azure_storage_percent_average{type=\"Microsoft.Sql/servers/databases\"})",
        "condition_op": "gt",
        "threshold": 90,
        "interval": "1m",
        "for": "15m",
        "severity": "critical",
        "message": "Database {{labels.name}} ({{labels.resource_group}}) is {{value}}% full — it stops accepting writes at 100%.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-storage-availability-low",
        "name": "Storage account availability degraded",
        "description": "A storage account is failing requests service-side, so applications reading or writing it see errors.",
        "query": "min by (resource_group, name) (azure_availability_average{type=\"Microsoft.Storage/storageAccounts\"})",
        "condition_op": "lt",
        "threshold": 99,
        "interval": "1m",
        "for": "10m",
        "severity": "critical",
        "message": "Storage account {{labels.name}} ({{labels.resource_group}}) is at {{value}}% availability — requests are failing service-side.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-servicebus-deadletter",
        "name": "Service Bus dead-lettered messages",
        "description": "Messages are landing in the dead-letter queue, meaning consumers are rejecting or timing out.",
        "query": "sum by (resource_group, name) (azure_deadletteredmessages_average{type=\"Microsoft.ServiceBus/namespaces\"})",
        "condition_op": "gt",
        "threshold": 0,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Service Bus namespace {{labels.name}} ({{labels.resource_group}}) holds {{value}} dead-lettered message(s) — consumers are rejecting or timing out.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-vm-low-memory",
        "name": "VM low available memory",
        "description": "A VM is nearly out of available memory, so paging and the OOM killer come next.",
        "query": "min by (resource_group, name) (azure_available_memory_bytes_average{type=\"Microsoft.Compute/virtualMachines\"})",
        "condition_op": "lt",
        "threshold": 268435456,
        "interval": "1m",
        "for": "15m",
        "severity": "critical",
        "message": "VM {{labels.name}} ({{labels.resource_group}}) has {{value | bytes}} of memory left — paging and the OOM killer come next.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-vm-high-cpu",
        "name": "VM high CPU",
        "description": "A VM has been running at sustained high CPU, leaving no headroom for load spikes.",
        "query": "avg by (resource_group, name) (azure_percentage_cpu_average{type=\"Microsoft.Compute/virtualMachines\"})",
        "condition_op": "gt",
        "threshold": 90,
        "interval": "1m",
        "for": "30m",
        "severity": "warning",
        "message": "VM {{labels.name}} ({{labels.resource_group}}) has averaged {{value}}% CPU for 30 minutes.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-sql-high-cpu",
        "name": "Azure SQL high CPU",
        "description": "An Azure SQL database is running at sustained high CPU for its service tier, degrading query latency.",
        "query": "avg by (resource_group, name) (azure_cpu_percent_average{type=\"Microsoft.Sql/servers/databases\"})",
        "condition_op": "gt",
        "threshold": 90,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Database {{labels.name}} ({{labels.resource_group}}) is at {{value}}% CPU of its service tier.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-sql-connection-failures",
        "name": "Azure SQL connection failures",
        "description": "Logins to an Azure SQL database keep failing, pointing at credentials, firewall rules, or limits.",
        "query": "sum by (resource_group, name) (azure_connection_failed_total{type=\"Microsoft.Sql/servers/databases\"})",
        "condition_op": "gt",
        "threshold": 10,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "Database {{labels.name}} ({{labels.resource_group}}) is rejecting {{value}} logins per period — check credentials, firewall rules, and connection limits.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-app-slow-responses",
        "name": "App Service slow responses",
        "description": "An App Service app is taking a long time to serve requests on average, so users are waiting.",
        "query": "max by (resource_group, name) (azure_httpresponsetime_average{type=\"Microsoft.Web/sites\"})",
        "condition_op": "gt",
        "threshold": 2,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "App Service {{labels.name}} ({{labels.resource_group}}) is averaging {{value}}s per request.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-vm-cpu-credits-low",
        "name": "VM CPU credits low",
        "description": "A burstable B-series VM is nearly out of CPU credits and will hard-throttle at zero.",
        "query": "min by (resource_group, name) (azure_cpu_credits_remaining_average{type=\"Microsoft.Compute/virtualMachines\"})",
        "condition_op": "lt",
        "threshold": 20,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "VM {{labels.name}} ({{labels.resource_group}}) is down to {{value}} CPU credits — it will hard-throttle at zero.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-sql-workers-high",
        "name": "Azure SQL worker saturation",
        "description": "An Azure SQL database is near the worker-thread limit of its tier, after which new queries are rejected.",
        "query": "max by (resource_group, name) (azure_workers_percent_average{type=\"Microsoft.Sql/servers/databases\"})",
        "condition_op": "gt",
        "threshold": 80,
        "interval": "1m",
        "for": "15m",
        "severity": "warning",
        "message": "Database {{labels.name}} ({{labels.resource_group}}) is using {{value}}% of its worker threads — new queries are rejected at 100%.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      },
      {
        "ref": "alert-azure-servicebus-throttled",
        "name": "Service Bus throttled requests",
        "description": "Service Bus is throttling requests because the namespace hit its tier quota, so senders and receivers slow down.",
        "query": "sum by (resource_group, name) (azure_throttledrequests_total{type=\"Microsoft.ServiceBus/namespaces\"})",
        "condition_op": "gt",
        "threshold": 0,
        "interval": "1m",
        "for": "10m",
        "severity": "warning",
        "message": "Service Bus namespace {{labels.name}} ({{labels.resource_group}}) is being throttled ({{value}} requests per period) — the tier quota is the limit.",
        "notify_on_resolve": true,
        "paused": false,
        "channels": []
      }
    ]
  }
}
