{
  "title": "Lens",
  "uid": "lens-overview",
  "schemaVersion": 39,
  "version": 1,
  "editable": true,
  "tags": [
    "lens"
  ],
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "refresh": "1m",
  "templating": {
    "list": [
      {
        "name": "datasource",
        "type": "datasource",
        "query": "prometheus",
        "label": "Prometheus",
        "current": {}
      }
    ]
  },
  "panels": [
    {
      "id": 1,
      "title": "Queued jobs",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(lens_jobs{status=\"queued\"})",
          "legendFormat": "queued",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 2,
      "title": "Running jobs",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 4,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(lens_jobs{status=\"running\"})",
          "legendFormat": "running",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 3,
      "title": "Failed jobs",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 8,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(lens_jobs{status=\"failed\"})",
          "legendFormat": "failed",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 4,
      "title": "Model cost, last 24h",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 12,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(lens_activity_cost_usd{window=\"24h\"})",
          "legendFormat": "USD",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "currencyUSD"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 5,
      "title": "Workers up",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 16,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "lens_workers_up",
          "legendFormat": "up",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 6,
      "title": "Disk free",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 20,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "lens_disk_free_bytes",
          "legendFormat": "free",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 7,
      "title": "Jobs by status",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 4,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (status) (lens_jobs)",
          "legendFormat": "{{status}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 8,
      "title": "Jobs by pipeline",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 12,
        "y": 4,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (pipeline) (lens_pipeline_jobs{status=~\"queued|running|held\"})",
          "legendFormat": "{{pipeline}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 9,
      "title": "Model calls per hour, by model",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 12,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (model) (lens_activity_calls{window=\"1h\",kind=\"out\"})",
          "legendFormat": "{{model}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 10,
      "title": "Tokens per hour, by model",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 8,
        "y": 12,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (model, direction) (lens_activity_tokens{window=\"1h\"})",
          "legendFormat": "{{model}} {{direction}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 11,
      "title": "Cost per hour, by model",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 16,
        "y": 12,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (model) (lens_activity_cost_usd{window=\"1h\"})",
          "legendFormat": "{{model}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "currencyUSD"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 12,
      "title": "Failed calls per hour",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 20,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (kind, model) (lens_activity_failed{window=\"1h\"})",
          "legendFormat": "{{kind}} {{model}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 13,
      "title": "Budgets used",
      "type": "bargauge",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 8,
        "y": 20,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "lens_budget_share",
          "legendFormat": "{{resource}} ({{period}})",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percentunit",
          "min": 0,
          "max": 1,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.8
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 14,
      "title": "Resources by status",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 16,
        "y": 20,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum by (status) (lens_resources)",
          "legendFormat": "{{status}}",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 15,
      "title": "Imports",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 28,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "lens_imports{window=\"1h\"}",
          "legendFormat": "last hour",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        },
        {
          "refId": "B",
          "expr": "lens_imports{window=\"24h\"}",
          "legendFormat": "last 24h",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 16,
      "title": "Storage",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 12,
        "y": 28,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "lens_data_bytes",
          "legendFormat": "data folder",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        },
        {
          "refId": "B",
          "expr": "lens_disk_free_bytes",
          "legendFormat": "disk free",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 17,
      "type": "row",
      "title": "Machine (node-exporter, with the monitoring profile)",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 36,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 18,
      "title": "Lens reachable",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "up{job=\"lens\"}",
          "legendFormat": "lens",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 19,
      "title": "Machine uptime",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 4,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "time() - node_boot_time_seconds",
          "legendFormat": "uptime",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 20,
      "title": "CPUs",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 8,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "count(node_cpu_seconds_total{mode=\"idle\"})",
          "legendFormat": "CPUs",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 21,
      "title": "Memory total",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 12,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "node_memory_MemTotal_bytes",
          "legendFormat": "total",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 22,
      "title": "Load (1 min)",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 16,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "node_load1",
          "legendFormat": "load",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 23,
      "title": "Network in",
      "type": "stat",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 20,
        "y": 37,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(rate(node_network_receive_bytes_total{device!=\"lo\"}[5m]))",
          "legendFormat": "in",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "Bps"
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 24,
      "title": "CPU used",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 0,
        "y": 41,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "100 * (1 - avg(rate(node_cpu_seconds_total{mode=\"idle\"}[5m])))",
          "legendFormat": "CPU",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 25,
      "title": "Memory used",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 8,
        "y": 41,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "100 * (1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)",
          "legendFormat": "memory",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {}
    },
    {
      "id": 26,
      "title": "Disk used",
      "type": "timeseries",
      "datasource": {
        "type": "prometheus",
        "uid": "${datasource}"
      },
      "gridPos": {
        "x": 16,
        "y": 41,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "refId": "A",
          "expr": "100 * (1 - node_filesystem_avail_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"})",
          "legendFormat": "/",
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {}
    }
  ],
  "annotations": {
    "list": []
  }
}
