feat: add grafana dashboard for token tracking
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"id": null,
|
||||
"title": "LLM Token Tracking",
|
||||
"timezone": "browser",
|
||||
"schemaVersion": 16,
|
||||
"version": 0,
|
||||
"refresh": "10s",
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "graph",
|
||||
"title": "Input Tokens by Room",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "rate(room_llm_input_tokens_total[5m])",
|
||||
"legendFormat": "{{room_id}} ({{model}})",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"xaxis": {
|
||||
"mode": "time"
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": "Tokens/sec"
|
||||
},
|
||||
{
|
||||
"format": "short"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "graph",
|
||||
"title": "Output Tokens by Room",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "rate(room_llm_output_tokens_total[5m])",
|
||||
"legendFormat": "{{room_id}} ({{model}})",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"xaxis": {
|
||||
"mode": "time"
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": "Tokens/sec"
|
||||
},
|
||||
{
|
||||
"format": "short"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "bargauge",
|
||||
"title": "Total Cost by Room",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "room_llm_cost_total",
|
||||
"legendFormat": "{{room_id}}",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"orientation": "horizontal",
|
||||
"displayMode": "gradient",
|
||||
"reduceOptions": {
|
||||
"calcs": [
|
||||
"last"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "table",
|
||||
"title": "Token Summary",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "room_llm_input_tokens_total",
|
||||
"legendFormat": "Input - {{room_id}} ({{model}})",
|
||||
"refId": "A"
|
||||
},
|
||||
{
|
||||
"expr": "room_llm_output_tokens_total",
|
||||
"legendFormat": "Output - {{room_id}} ({{model}})",
|
||||
"refId": "B"
|
||||
},
|
||||
{
|
||||
"expr": "room_llm_cost_total",
|
||||
"legendFormat": "Cost - {{room_id}} ({{model}})",
|
||||
"refId": "C"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "seriesToColumns",
|
||||
"options": {
|
||||
"byField": "room_id"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {
|
||||
"align": "auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
- name: 'Token Tracking'
|
||||
orgId: 1
|
||||
folder: ''
|
||||
type: file
|
||||
disableDeletion: false
|
||||
editable: true
|
||||
options:
|
||||
path: /etc/grafana/dashboards
|
||||
Reference in New Issue
Block a user