{
  "dashboard": {
    "id": null,
    "title": "Vaultwarden Monitoring",
    "tags": ["vaultwarden", "password-manager", "security"],
    "style": "dark",
    "timezone": "browser",
    "panels": [
      {
        "id": 1,
        "title": "Vaultwarden Availability",
        "type": "stat",
        "targets": [
          {
            "expr": "up{job=\"vaultwarden-monitoring\"}",
            "legendFormat": "{{instance}}"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "thresholds": {
              "steps": [
                {"color": "red", "value": 0},
                {"color": "green", "value": 1}
              ]
            }
          }
        },
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}
      },
      {
        "id": 2,
        "title": "Response Time",
        "type": "graph",
        "targets": [
          {
            "expr": "probe_duration_seconds{job=\"vaultwarden-monitoring\"}",
            "legendFormat": "{{instance}}"
          }
        ],
        "yAxes": [
          {
            "label": "Response Time (seconds)",
            "min": 0
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}
      },
      {
        "id": 3,
        "title": "HTTP Status Codes",
        "type": "graph",
        "targets": [
          {
            "expr": "probe_http_status_code{job=\"vaultwarden-monitoring\"}",
            "legendFormat": "{{instance}} - {{code}}"
          }
        ],
        "yAxes": [
          {
            "label": "Status Code",
            "min": 0,
            "max": 600
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}
      },
      {
        "id": 4,
        "title": "SSL Certificate Expiry",
        "type": "stat",
        "targets": [
          {
            "expr": "probe_ssl_earliest_cert_expiry{job=\"vaultwarden-monitoring\"} - time()",
            "legendFormat": "{{instance}}"
          }
        ],
        "fieldConfig": {
          "defaults": {
            "unit": "s",
            "color": {
              "mode": "thresholds"
            },
            "thresholds": {
              "steps": [
                {"color": "red", "value": 0},
                {"color": "orange", "value": 86400},
                {"color": "green", "value": 604800}
              ]
            }
          }
        },
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8}
      },
      {
        "id": 5,
        "title": "Container Resource Usage",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(container_cpu_usage_seconds_total{name=~\".*vaultwarden.*\"}[5m]) * 100",
            "legendFormat": "CPU % - {{name}}"
          },
          {
            "expr": "container_memory_usage_bytes{name=~\".*vaultwarden.*\"} / 1024 / 1024",
            "legendFormat": "Memory MB - {{name}}"
          }
        ],
        "yAxes": [
          {
            "label": "CPU % / Memory MB"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}
      },
      {
        "id": 6,
        "title": "Network Traffic",
        "type": "graph",
        "targets": [
          {
            "expr": "rate(container_network_receive_bytes_total{name=~\".*vaultwarden.*\"}[5m]) / 1024 / 1024",
            "legendFormat": "Receive MB/s - {{name}}"
          },
          {
            "expr": "rate(container_network_transmit_bytes_total{name=~\".*vaultwarden.*\"}[5m]) / 1024 / 1024",
            "legendFormat": "Transmit MB/s - {{name}}"
          }
        ],
        "yAxes": [
          {
            "label": "MB/s"
          }
        ],
        "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}
      }
    ],
    "time": {
      "from": "now-1h",
      "to": "now"
    },
    "refresh": "30s"
  }
}
