{
  "annotations": {
    "list": []
  },
  "editable": false,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "decimals": 0,
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(up{job=\"who-need-help-web\"})",
          "legendFormat": "available",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Available web replicas",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "reqps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 16,
        "x": 8,
        "y": 0
      },
      "id": 2,
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "editorMode": "code",
          "expr": "rate(who_need_help_http_requests_total[1m])",
          "legendFormat": "{{instance}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "HTTP request rate by replica",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 8
      },
      "id": 3,
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "editorMode": "code",
          "expr": "who_need_help_vm_memory_total_bytes",
          "legendFormat": "{{instance}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "BEAM memory by replica",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 8
      },
      "id": 4,
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "editorMode": "code",
          "expr": "rate(who_need_help_database_queries_total[1m])",
          "legendFormat": "{{instance}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Database query rate by replica",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 16
      },
      "id": 5,
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(up{job=\"who-need-help-worker\"})",
          "legendFormat": "available",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Available worker replicas",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 16,
        "x": 8,
        "y": 16
      },
      "id": 6,
      "targets": [
        {
          "editorMode": "code",
          "expr": "histogram_quantile(0.95, sum by (le, instance) (rate(who_need_help_http_request_duration_seconds_bucket{job=\"who-need-help-web\"}[1m])))",
          "legendFormat": "p95 {{instance}}",
          "range": true,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "histogram_quantile(0.99, sum by (le, instance) (rate(who_need_help_http_request_duration_seconds_bucket{job=\"who-need-help-web\"}[1m])))",
          "legendFormat": "p99 {{instance}}",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "HTTP request latency by web replica",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 24
      },
      "id": 7,
      "targets": [
        {
          "editorMode": "code",
          "expr": "histogram_quantile(0.95, sum by (le, instance) (rate(who_need_help_database_query_duration_seconds_bucket[1m])))",
          "legendFormat": "query p95 {{instance}}",
          "range": true,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "histogram_quantile(0.95, sum by (le, instance) (rate(who_need_help_database_query_queue_duration_seconds_bucket[1m])))",
          "legendFormat": "pool wait p95 {{instance}}",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Database query and pool-wait latency",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "ops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 24
      },
      "id": 8,
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (queue) (rate(who_need_help_oban_jobs_completed_total{job=\"who-need-help-worker\"}[1m]))",
          "legendFormat": "completed {{queue}}",
          "range": true,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "sum by (queue) (rate(who_need_help_oban_jobs_failed_total{job=\"who-need-help-worker\"}[1m]))",
          "legendFormat": "failed {{queue}}",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Oban job outcomes by queue",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 32
      },
      "id": 9,
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (queue) (rate(who_need_help_oban_job_duration_microseconds_total{job=\"who-need-help-worker\"}[5m])) / sum by (queue) (rate(who_need_help_oban_jobs_completed_total{job=\"who-need-help-worker\"}[5m])) / 1000",
          "legendFormat": "execution {{queue}}",
          "range": true,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "sum by (queue) (rate(who_need_help_oban_job_queue_duration_microseconds_total{job=\"who-need-help-worker\"}[5m])) / sum by (queue) (rate(who_need_help_oban_jobs_completed_total{job=\"who-need-help-worker\"}[5m])) / 1000",
          "legendFormat": "queue wait {{queue}}",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Average Oban execution and queue wait",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "wnh-prometheus"
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 32
      },
      "id": 10,
      "targets": [
        {
          "editorMode": "code",
          "expr": "who_need_help_vm_run_queue_total",
          "legendFormat": "{{job}} {{instance}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "BEAM scheduler run queue by replica",
      "type": "timeseries"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 42,
  "tags": ["who-need-help", "local"],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-15m",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Who Need Help local overview",
  "uid": "wnh-overview",
  "version": 1
}
