Feature/metering dashboard (#89)

* Bump version

* Added Prom metrics to metering, added dashboard

* Update YAMLs

* Add $ on axis

* Tweak dashboard
This commit is contained in:
cybermaggedon 2024-10-01 06:46:41 +01:00 committed by GitHub
parent 88a7dfa126
commit ef1b8b5a13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 616 additions and 358 deletions

View file

@ -280,7 +280,7 @@
"editorMode": "builder",
"expr": "rate(request_latency_count[1m])",
"instant": false,
"legendFormat": "{{instance}}",
"legendFormat": "{{job}}",
"range": true,
"refId": "A"
}
@ -824,7 +824,7 @@
},
"gridPos": {
"h": 7,
"w": 12,
"w": 8,
"x": 0,
"y": 32
},
@ -869,8 +869,8 @@
"options": {
"include": {
"names": [
"instance",
"model"
"model",
"job"
]
}
}
@ -895,6 +895,238 @@
}
],
"type": "table"
},
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 8,
"x": 8,
"y": 32
},
"id": 15,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (rate(input_tokens_total[$__rate_interval]))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "input {{job}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (rate(output_tokens_total[$__rate_interval]))",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "output {{job}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Tokens",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "$",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 8,
"x": 16,
"y": 32
},
"id": 16,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (rate(input_cost_total[$__rate_interval]))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "input {{job}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "f6b18033-5918-4e05-a1ca-4cb30343b129"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (rate(output_cost_total[$__rate_interval]))",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "output {{job}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Token cost",
"type": "timeseries"
}
],
"refresh": "5s",
@ -911,6 +1143,6 @@
"timezone": "",
"title": "Overview",
"uid": "b5c8abf8-fe79-496b-b028-10bde917d1f0",
"version": 3,
"version": 1,
"weekStart": ""
}