{
  "dashboard": {
    "title": "Entra VerifiedID Integration",
    "tags": ["entra", "verifiedid", "credentials"],
    "timezone": "browser",
    "panels": [
      {
        "id": 1,
        "title": "Issuance Success Rate",
        "type": "gauge",
        "targets": [
          {
            "expr": "rate(entra_credentials_issued_total{status=\"success\"}[5m]) / rate(entra_credentials_issued_total[5m]) * 100",
            "legendFormat": "Success Rate"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0},
        "fieldConfig": {
          "defaults": {
            "min": 0,
            "max": 100,
            "unit": "percent",
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {"value": 0, "color": "red"},
                {"value": 90, "color": "yellow"},
                {"value": 95, "color": "green"}
              ]
            }
          }
        }
      },
      {
        "id": 2,
        "title": "API Request Rate",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(entra_api_requests_total[5m])",
            "legendFormat": "{{operation}} - {{status}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}
      },
      {
        "id": 3,
        "title": "Error Rate by Operation",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(entra_api_errors_total[5m])",
            "legendFormat": "{{operation}} - {{error_type}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}
      },
      {
        "id": 4,
        "title": "Issuance Duration",
        "type": "graph",
        "targets": [
          {
            "expr": "histogram_quantile(0.95, entra_issuance_duration_seconds_bucket)",
            "legendFormat": "p95"
          },
          {
            "expr": "histogram_quantile(0.50, entra_issuance_duration_seconds_bucket)",
            "legendFormat": "p50"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8}
      },
      {
        "id": 5,
        "title": "Webhook Events",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(entra_webhooks_received_total[5m])",
            "legendFormat": "{{event_type}} - {{status}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}
      },
      {
        "id": 6,
        "title": "Active Requests",
        "type": "gauge",
        "targets": [
          {
            "expr": "entra_active_requests",
            "legendFormat": "{{operation}}"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}
      },
      {
        "id": 7,
        "title": "Credentials Issued by Manifest",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(entra_credentials_issued_total[5m])",
            "legendFormat": "{{manifest_name}} - {{status}}"
          }
        ],
        "gridPos": {"h": 8, "w": 24, "x": 0, "y": 24}
      }
    ],
    "refresh": "30s",
    "schemaVersion": 27,
    "version": 1
  }
}

