Files
nix-config/modules/nixos/services/grafana/dashboards/gitea.json
mjallen18 7798684d29 grafana
2026-03-24 10:20:46 -05:00

247 lines
7.2 KiB
JSON

{
"title": "Gitea",
"uid": "jallen-gitea",
"schemaVersion": 38,
"version": 1,
"refresh": "1m",
"time": { "from": "now-6h", "to": "now" },
"templating": {
"list": [
{
"name": "datasource",
"type": "datasource",
"query": "prometheus",
"current": {},
"hide": 0,
"label": "Datasource"
}
]
},
"panels": [
{
"id": 1,
"type": "stat",
"title": "Repositories",
"gridPos": { "x": 0, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_repositories",
"legendFormat": "repos",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 2,
"type": "stat",
"title": "Users",
"gridPos": { "x": 4, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_users",
"legendFormat": "users",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 3,
"type": "stat",
"title": "Open Issues",
"gridPos": { "x": 8, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_issues_open",
"legendFormat": "open issues",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 4,
"type": "stat",
"title": "Open PRs",
"gridPos": { "x": 12, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "purple", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_issues_open{type=\"pull_request\"}",
"legendFormat": "open PRs",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 5,
"type": "stat",
"title": "Orgs",
"gridPos": { "x": 16, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_organizations",
"legendFormat": "orgs",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 6,
"type": "stat",
"title": "Mirrors",
"gridPos": { "x": 20, "y": 0, "w": 4, "h": 4 },
"options": { "reduceOptions": { "calcs": ["lastNotNull"] } },
"fieldConfig": {
"defaults": {
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] },
"color": { "mode": "thresholds" }
}
},
"targets": [
{
"expr": "gitea_repositories_mirrors",
"legendFormat": "mirrors",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 7,
"type": "timeseries",
"title": "HTTP Request Rate by Method",
"gridPos": { "x": 0, "y": 4, "w": 12, "h": 8 },
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": { "lineWidth": 2, "fillOpacity": 5 }
}
},
"targets": [
{
"expr": "sum(rate(gitea_access_total[5m])) by (method)",
"legendFormat": "{{method}}",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 8,
"type": "timeseries",
"title": "HTTP Response Codes",
"gridPos": { "x": 12, "y": 4, "w": 12, "h": 8 },
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": { "lineWidth": 2, "fillOpacity": 5 }
},
"overrides": [
{ "matcher": { "id": "byName", "options": "5xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }] },
{ "matcher": { "id": "byName", "options": "4xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }] },
{ "matcher": { "id": "byName", "options": "2xx" }, "properties": [{ "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }] }
]
},
"targets": [
{
"expr": "sum(rate(gitea_access_total{code=~\"2..\"}[5m]))",
"legendFormat": "2xx",
"datasource": { "type": "prometheus", "uid": "$datasource" }
},
{
"expr": "sum(rate(gitea_access_total{code=~\"4..\"}[5m]))",
"legendFormat": "4xx",
"datasource": { "type": "prometheus", "uid": "$datasource" }
},
{
"expr": "sum(rate(gitea_access_total{code=~\"5..\"}[5m]))",
"legendFormat": "5xx",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 9,
"type": "timeseries",
"title": "Repository & User Growth",
"gridPos": { "x": 0, "y": 12, "w": 12, "h": 8 },
"fieldConfig": {
"defaults": {
"custom": { "lineWidth": 2 }
}
},
"targets": [
{
"expr": "gitea_repositories",
"legendFormat": "Repositories",
"datasource": { "type": "prometheus", "uid": "$datasource" }
},
{
"expr": "gitea_users",
"legendFormat": "Users",
"datasource": { "type": "prometheus", "uid": "$datasource" }
},
{
"expr": "gitea_organizations",
"legendFormat": "Organizations",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
},
{
"id": 10,
"type": "timeseries",
"title": "Issues & PRs Over Time",
"gridPos": { "x": 12, "y": 12, "w": 12, "h": 8 },
"fieldConfig": {
"defaults": {
"custom": { "lineWidth": 2 }
}
},
"targets": [
{
"expr": "gitea_issues_open",
"legendFormat": "Open Issues",
"datasource": { "type": "prometheus", "uid": "$datasource" }
},
{
"expr": "gitea_issues_closed",
"legendFormat": "Closed Issues",
"datasource": { "type": "prometheus", "uid": "$datasource" }
}
]
}
]
}