Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

43.4 KB
Raw Blame
{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "#00FFE5",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 2,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "panels": [],
      "title": "Token Cockpit",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_operation_tokens_total{account_id=~\"$account_id\",operation=~\"$operation\"}[5m]))",
          "legendFormat": "All tokens/sec",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "All Tokens/s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#6EE7FF",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 4,
        "y": 1
      },
      "id": 3,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_vlm_tokens_input_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "VLM input/s",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "VLM Input Tokens/s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#FFD60A",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 8,
        "y": 1
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_vlm_tokens_output_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "VLM output/s",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "VLM Output Tokens/s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#2CE26A",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 12,
        "y": 1
      },
      "id": 5,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_embedding_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "Embedding tokens/s",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Embedding Tokens/s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#A78BFA",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 16,
        "y": 1
      },
      "id": 6,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_rerank_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "Rerank tokens/s",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Rerank Tokens/s",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 20,
        "y": 1
      },
      "id": 7,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum(rate(openviking_operation_tokens_total{account_id=~\"$account_id\",operation=~\"$operation\"}[5m])) / clamp_min(sum(rate(openviking_operation_requests_total{account_id=~\"$account_id\",operation=~\"$operation\"}[5m])), 1e-9)",
          "legendFormat": "tokens/request",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Tokens / Operation Req",
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 8,
      "panels": [],
      "title": "Token Totals (Selected Time Range)",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 0,
        "y": 7
      },
      "id": 12,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "((sum(increase(openviking_vlm_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0)) + (sum(increase(openviking_embedding_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0)) + (sum(increase(openviking_rerank_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0)))",
          "legendFormat": "total tokens",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Total Tokens (range)",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#6EE7FF",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 4,
        "y": 7
      },
      "id": 13,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "(sum(increase(openviking_vlm_tokens_input_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0))",
          "legendFormat": "vlm input",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "VLM Input (range)",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#FFD60A",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 8,
        "y": 7
      },
      "id": 14,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "(sum(increase(openviking_vlm_tokens_output_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0))",
          "legendFormat": "vlm output",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "VLM Output (range)",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#2CE26A",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 12,
        "y": 7
      },
      "id": 15,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "(sum(increase(openviking_embedding_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0))",
          "legendFormat": "embedding",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Embedding (range)",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#A78BFA",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 16,
        "y": 7
      },
      "id": 16,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "(sum(increase(openviking_rerank_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0))",
          "legendFormat": "rerank",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Rerank (range)",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 20,
        "y": 7
      },
      "id": 17,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 12,
          "valueSize": 26
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "(((sum(increase(openviking_vlm_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0)) + (sum(increase(openviking_embedding_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0)) + (sum(increase(openviking_rerank_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[$__range])) or vector(0))) * 86400) / $__range_s",
          "legendFormat": "tokens/day",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Avg Tokens / Day (range)",
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 10,
      "panels": [],
      "title": "Token Calendar (GitHub-style)",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "Annual GitHub-style token calendar rendered by tim012432-calendarheatmap-panel. Uses a log2-transformed daily token value so low-traffic days remain visible.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#2A2F3A",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 13
      },
      "id": 1100,
      "options": {
        "aggregation": "last",
        "autoRectSize": true,
        "colorScheme": "green",
        "customColor": "#22c55e",
        "emptyColor": "#2A2F3A",
        "monthLabelCustom": "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
        "monthLabelMode": "default",
        "radius": 2,
        "rectSize": 11,
        "showLegend": true,
        "showMonthLabels": true,
        "showTooltip": true,
        "showWeekLabels": true,
        "space": 3,
        "weekLabelCustom": "Sun,Mon,Tue,Wed,Thu,Fri,Sat",
        "weekLabelMode": "default",
        "weekStart": "monday"
      },
      "pluginVersion": "1.1.0",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "clamp_min(log2(sum by () (increase(openviking_operation_tokens_total{account_id=~\"$account_id\",operation=~\"$operation\"}[1d])) + 1), 0)",
          "interval": "1d",
          "legendFormat": "daily_log2_tokens",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Annual Token Contribution Calendar",
      "transparent": false,
      "type": "tim012432-calendarheatmap-panel"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 24
      },
      "id": 20,
      "panels": [],
      "title": "Full Cycle: per-call -> attribution -> ledger",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 12,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 4,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 25
      },
      "id": 21,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (provider, model_name) (rate(openviking_vlm_tokens_input_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "vlm input {{provider}}/{{model_name}}",
          "range": true,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "sum by (provider, model_name) (rate(openviking_vlm_tokens_output_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "vlm output {{provider}}/{{model_name}}",
          "range": true,
          "refId": "B"
        },
        {
          "editorMode": "code",
          "expr": "sum by (provider, model_name) (rate(openviking_embedding_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "embedding {{provider}}/{{model_name}}",
          "range": true,
          "refId": "C"
        },
        {
          "editorMode": "code",
          "expr": "sum by (provider, model_name) (rate(openviking_rerank_tokens_total{account_id=~\"$account_id\",provider=~\"$provider\",model_name=~\"$model_name\"}[5m]))",
          "legendFormat": "rerank {{provider}}/{{model_name}}",
          "range": true,
          "refId": "D"
        }
      ],
      "title": "A) per-call Tokens/s (VLM / Embedding / Rerank)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 70,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 0,
            "pointSize": 2,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "stacking": {
              "group": "B",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 0,
        "y": 35
      },
      "id": 22,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (stage) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\",operation=~\"$operation\"}[5m]))",
          "legendFormat": "{{stage}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "B) Operation Token Attribution by Stage (stacked)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 70,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 0,
            "pointSize": 2,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "stacking": {
              "group": "C",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 12,
        "y": 35
      },
      "id": 23,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (stage, token_type) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\",operation=~\"$operation\"}[5m]))",
          "legendFormat": "{{stage}} / {{token_type}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "B2) Operation Token Attribution by Stage + Token Type",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 70,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 0,
            "pointSize": 2,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "stacking": {
              "group": "D",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 45
      },
      "id": 24,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "sum by (model_type, token_type) (rate(openviking_model_tokens_total[5m]))",
          "legendFormat": "{{model_type}} / {{token_type}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "C) Unified Ledger: openviking_model_tokens_total (rate)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 10,
        "x": 0,
        "y": 55
      },
      "id": 25,
      "options": {
        "displayLabels": [
          "name",
          "percent"
        ],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "percent",
            "value"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "topk(10, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m])))",
          "instant": true,
          "legendFormat": "{{operation}}",
          "range": false,
          "refId": "A"
        }
      ],
      "title": "Top Operations by Token Share (topk 10)",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "tokens/s",
            "axisPlacement": "bottom",
            "barAlignment": 0,
            "fillOpacity": 85,
            "gradientMode": "none",
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "showValue": "auto"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#9FB0E2",
                "value": null
              },
              {
                "color": "#00FFE5",
                "value": 1
              }
            ]
          },
          "unit": "tps"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#FFD60A",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#00FFE5",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#A78BFA",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#64748B",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 14,
        "x": 10,
        "y": 55
      },
      "id": 26,
      "options": {
        "barRadius": 0,
        "barWidth": 0.88,
        "fullHighlight": false,
        "groupWidth": 0.9,
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "orientation": "horizontal",
        "showValue": "always",
        "stacking": "none",
        "tooltip": {
          "mode": "single"
        },
        "xTickLabelRotation": 0,
        "xTickLabelSpacing": 0
      },
      "pluginVersion": "12.4.1",
      "targets": [
        {
          "editorMode": "code",
          "expr": "topk(1, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m])))",
          "instant": true,
          "legendFormat": "{{operation}}",
          "range": false,
          "refId": "A"
        },
        {
          "editorMode": "code",
          "expr": "topk(2, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m]))) unless topk(1, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m])))",
          "instant": true,
          "legendFormat": "{{operation}}",
          "range": false,
          "refId": "B"
        },
        {
          "editorMode": "code",
          "expr": "topk(3, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m]))) unless topk(2, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m])))",
          "instant": true,
          "legendFormat": "{{operation}}",
          "range": false,
          "refId": "C"
        },
        {
          "editorMode": "code",
          "expr": "topk(10, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m]))) unless topk(3, sum by (operation) (rate(openviking_operation_tokens_total{account_id=~\"$account_id\"}[5m])))",
          "instant": true,
          "legendFormat": "{{operation}}",
          "range": false,
          "refId": "D"
        }
      ],
      "title": "Top Operations by Token Rate (top10, top3 highlighted)",
      "type": "barchart"
    }
  ],
  "preload": false,
  "refresh": "30s",
  "schemaVersion": 42,
  "tags": [
    "openviking",
    "metrics",
    "prometheus",
    "token",
    "developer",
    "cockpit"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "text": "Prometheus",
          "value": "prometheus"
        },
        "includeAll": false,
        "label": "datasource",
        "name": "DS_PROMETHEUS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "type": "datasource"
      },
      {
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(openviking_operation_tokens_total, account_id)",
        "includeAll": true,
        "label": "account_id",
        "multi": true,
        "name": "account_id",
        "options": [],
        "query": {
          "query": "label_values(openviking_operation_tokens_total, account_id)",
          "refId": "account_id-var"
        },
        "refresh": 2,
        "regex": "",
        "regexApplyTo": "value",
        "sort": 1,
        "type": "query"
      },
      {
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(openviking_operation_tokens_total{account_id=~\"$account_id\"}, operation)",
        "includeAll": true,
        "label": "operation",
        "multi": true,
        "name": "operation",
        "options": [],
        "query": {
          "query": "label_values(openviking_operation_tokens_total{account_id=~\"$account_id\"}, operation)",
          "refId": "operation-var"
        },
        "refresh": 2,
        "regex": "",
        "regexApplyTo": "value",
        "sort": 1,
        "type": "query"
      },
      {
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(openviking_model_calls_total, provider)",
        "includeAll": true,
        "label": "provider",
        "multi": true,
        "name": "provider",
        "options": [],
        "query": {
          "query": "label_values(openviking_model_calls_total, provider)",
          "refId": "provider-var"
        },
        "refresh": 2,
        "regex": "",
        "regexApplyTo": "value",
        "sort": 1,
        "type": "query"
      },
      {
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(openviking_model_calls_total{provider=~\"$provider\"}, model_name)",
        "includeAll": true,
        "label": "model_name",
        "multi": true,
        "name": "model_name",
        "options": [],
        "query": {
          "query": "label_values(openviking_model_calls_total{provider=~\"$provider\"}, model_name)",
          "refId": "model_name-var"
        },
        "refresh": 2,
        "regex": "",
        "regexApplyTo": "value",
        "sort": 1,
        "type": "query"
      },
      {
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(openviking_operation_tokens_total, stage)",
        "includeAll": true,
        "label": "stage",
        "multi": true,
        "name": "stage",
        "options": [],
        "query": {
          "query": "label_values(openviking_operation_tokens_total, stage)",
          "refId": "stage-var"
        },
        "refresh": 2,
        "regex": "",
        "regexApplyTo": "value",
        "sort": 1,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-365d",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "OpenViking - Token Cockpit",
  "uid": "openviking-token-cockpit",
  "version": 1,
  "weekStart": ""
}