{
  "title": "Cortex - System Overview",
  "uid": "cortex-overview",
  "version": 1,
  "timezone": "browser",
  "panels": [
    {
      "title": "Search Requests",
      "type": "graph",
      "targets": [{ "expr": "rate(cortex_search_total[5m])", "legendFormat": "search/s" }],
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 }
    },
    {
      "title": "Cache Hit Rate",
      "type": "graph",
      "targets": [{
        "expr": "rate(cortex_search_cache_hits_total[5m]) / (rate(cortex_search_cache_hits_total[5m]) + rate(cortex_search_cache_misses_total[5m])) * 100",
        "legendFormat": "hit rate %"
      }],
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 }
    },
    {
      "title": "Search Latency (P50/P95)",
      "type": "graph",
      "targets": [
        { "expr": "histogram_quantile(0.50, rate(cortex_search_duration_seconds_bucket[5m]))", "legendFormat": "P50" },
        { "expr": "histogram_quantile(0.95, rate(cortex_search_duration_seconds_bucket[5m]))", "legendFormat": "P95" }
      ],
      "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 }
    },
    {
      "title": "Documents & Vectors",
      "type": "stat",
      "targets": [
        { "expr": "cortex_documents_total", "legendFormat": "Documents" },
        { "expr": "cortex_vectors_total", "legendFormat": "Vectors" }
      ],
      "gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 }
    }
  ]
}
