{
  "dashboard": {
    "title": "ERP Report Service",
    "uid": "erp-report-service",
    "tags": ["erp", "report", "microservice"],
    "timezone": "Asia/Shanghai",
    "panels": [
      {
        "id": 1,
        "title": "请求QPS",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(http_server_requests_seconds_count{uri=~\"/tenant/reports/.*\"}[1m])",
            "legendFormat": "{{uri}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}
      },
      {
        "id": 2,
        "title": "响应时间 P99",
        "type": "graph",
        "targets": [
          {
            "expr": "histogram_quantile(0.99, rate(http_server_requests_seconds_bucket{uri=~\"/tenant/reports/.*\"}[5m]))",
            "legendFormat": "{{uri}} P99"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}
      },
      {
        "id": 3,
        "title": "JVM内存使用",
        "type": "graph",
        "targets": [
          {
            "expr": "jvm_memory_used_bytes{area=\"heap\"}",
            "legendFormat": "{{id}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}
      },
      {
        "id": 4,
        "title": "活跃线程数",
        "type": "graph",
        "targets": [
          {
            "expr": "jvm_threads_live_threads",
            "legendFormat": "活跃线程"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8}
      },
      {
        "id": 5,
        "title": "数据库连接池",
        "type": "graph",
        "targets": [
          {
            "expr": "hikaricp_connections_active{pool=\"HikariPool-1\"}",
            "legendFormat": "活跃连接"
          },
          {
            "expr": "hikaricp_connections_idle{pool=\"HikariPool-1\"}",
            "legendFormat": "空闲连接"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}
      },
      {
        "id": 6,
        "title": "错误率",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(http_server_requests_seconds_count{status=~\"5..\", uri=~\"/tenant/reports/.*\"}[5m]) / rate(http_server_requests_seconds_count{uri=~\"/tenant/reports/.*\"}[5m])",
            "legendFormat": "错误率"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}
      }
    ]
  }
}
