{
  "uid": "briven-runtime-invocations",
  "title": "runtime · invocations",
  "tags": ["briven", "runtime"],
  "timezone": "browser",
  "schemaVersion": 39,
  "refresh": "30s",
  "time": { "from": "now-1h", "to": "now" },
  "panels": [
    {
      "id": 1,
      "title": "invocations per second",
      "type": "timeseries",
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
      "targets": [
        {
          "expr": "sum by (project) (rate(briven_runtime_invocations_total[1m]))",
          "legendFormat": "{{project}}"
        }
      ]
    },
    {
      "id": 2,
      "title": "cold-start time (p50/p99 ms)",
      "type": "timeseries",
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 },
      "targets": [
        {
          "expr": "histogram_quantile(0.50, sum by (le) (rate(briven_runtime_cold_start_ms_bucket[5m])))",
          "legendFormat": "p50"
        },
        {
          "expr": "histogram_quantile(0.99, sum by (le) (rate(briven_runtime_cold_start_ms_bucket[5m])))",
          "legendFormat": "p99"
        }
      ]
    },
    {
      "id": 3,
      "title": "active isolates",
      "type": "stat",
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "gridPos": { "x": 0, "y": 8, "w": 6, "h": 4 },
      "targets": [
        {
          "expr": "sum(briven_runtime_isolates_active)"
        }
      ]
    },
    {
      "id": 4,
      "title": "isolate kills (last 5m, by reason)",
      "type": "timeseries",
      "datasource": { "type": "prometheus", "uid": "Prometheus" },
      "gridPos": { "x": 6, "y": 8, "w": 18, "h": 4 },
      "targets": [
        {
          "expr": "sum by (reason) (increase(briven_runtime_isolate_kills_total[5m]))",
          "legendFormat": "{{reason}}"
        }
      ]
    }
  ]
}
