{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "iteration": 1681169345054,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "$PROMETHEUS_DS"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "displayMode": "gradient",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true
      },
      "pluginVersion": "8.3.3",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "exemplar": true,
          "expr": "kube_pod_labels{\n  label_app=\"jupyterhub\",\n  label_component=\"singleuser-server\",\n  namespace=~\"$hub\",\n  job=\"kube-state-metrics\"\n}\n* on (namespace, pod) group_left()\nsum(\n  container_memory_working_set_bytes{\n    namespace=~\"$hub\",\n    container=\"notebook\",\n    name!=\"\",\n  }\n) by (namespace, pod)\n",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{label_hub_jupyter_org_username}} ({{namespace}})",
          "refId": "A"
        }
      ],
      "title": "User pod memory usage",
      "type": "bargauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "$PROMETHEUS_DS"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 3,
      "options": {
        "displayMode": "gradient",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true
      },
      "pluginVersion": "8.3.3",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "exemplar": true,
          "expr": "sum(\n  kube_pod_labels{\n    namespace=~\"$hub\",\n    label_app_kubernetes_io_component=\"dask-worker\",\n  }\n  * on (namespace, pod) group_left()\n  sum(\n    container_memory_working_set_bytes{\n      namespace=~\"$hub\",\n      container=\"dask-worker\",\n      name!=\"\",\n    }\n  ) by (namespace, pod)\n) by (label_gateway_dask_org_cluster)\n",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{label_hub_jupyter_org_username}}-{{label_gateway_dask_org_cluster}}",
          "refId": "A"
        }
      ],
      "title": "Dask-gateway worker pod memory usage",
      "type": "bargauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "$PROMETHEUS_DS"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 20
      },
      "id": 4,
      "options": {
        "displayMode": "gradient",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true
      },
      "pluginVersion": "8.3.3",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "PBFA97CFB590B2093"
          },
          "exemplar": true,
          "expr": "sum(\n  kube_pod_labels{\n    namespace=~\"$hub\",\n    label_app_kubernetes_io_component=\"dask-scheduler\",\n  }\n  * on (namespace, pod) group_left()\n  sum(\n    container_memory_working_set_bytes{\n      namespace=~\"$hub\",\n      container=\"dask-scheduler\",\n      name!=\"\",\n    }\n  ) by (namespace, pod)\n) by (label_gateway_dask_org_cluster)\n",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{label_hub_jupyter_org_username}}-{{label_gateway_dask_org_cluster}}",
          "refId": "A"
        }
      ],
      "title": "Dask-gateway scheduler pod memory usage",
      "type": "bargauge"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 34,
  "style": "dark",
  "tags": [
    "jupyterhub",
    "dask"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Prometheus",
          "value": "Prometheus"
        },
        "hide": 1,
        "includeAll": false,
        "multi": false,
        "name": "PROMETHEUS_DS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": false,
          "text": "dev",
          "value": "dev"
        },
        "datasource": {
          "uid": "$PROMETHEUS_DS"
        },
        "definition": "label_values({service=\"hub\"},namespace)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "hub",
        "options": [],
        "query": {
          "query": "label_values({service=\"hub\"},namespace)",
          "refId": "Prometheus-hub-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Usage Report",
  "uid": "usage-report",
  "version": 1,
  "weekStart": ""
}
