Files
infra/stacks/monitoring/grafana/provisioning/dashboards/gitea.json

86 lines
4.7 KiB
JSON

{
"uid": "gitea-infra",
"title": "Gitea",
"tags": ["gitea", "infra"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": { "from": "now-6h", "to": "now" },
"templating": {
"list": [
{
"name": "instance",
"type": "query",
"datasource": { "type": "prometheus", "uid": "prometheus" },
"query": { "query": "label_values(gitea_build_info, instance)", "refId": "var" },
"refresh": 2,
"includeAll": true,
"multi": true,
"current": { "text": "All", "value": "$__all" }
}
]
},
"panels": [
{
"type": "stat", "title": "Репозитории", "gridPos": { "h": 4, "w": 6, "x": 0, "y": 0 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_repositories{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "blue", "value": null } ] } } }
},
{
"type": "stat", "title": "Пользователи", "gridPos": { "h": 4, "w": 6, "x": 6, "y": 0 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_users{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "green", "value": null } ] } } }
},
{
"type": "stat", "title": "Организации", "gridPos": { "h": 4, "w": 6, "x": 12, "y": 0 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_organizations{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "purple", "value": null } ] } } }
},
{
"type": "stat", "title": "Релизы", "gridPos": { "h": 4, "w": 6, "x": 18, "y": 0 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_releases{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "orange", "value": null } ] } } }
},
{
"type": "stat", "title": "Issues открытых", "gridPos": { "h": 4, "w": 6, "x": 0, "y": 4 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_issues_open{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "red", "value": null } ] } } }
},
{
"type": "stat", "title": "Issues закрытых", "gridPos": { "h": 4, "w": 6, "x": 6, "y": 4 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_issues_closed{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "green", "value": null } ] } } }
},
{
"type": "stat", "title": "Звёзды", "gridPos": { "h": 4, "w": 6, "x": 12, "y": 4 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_stars{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "yellow", "value": null } ] } } }
},
{
"type": "stat", "title": "SSH-ключи", "gridPos": { "h": 4, "w": 6, "x": 18, "y": 4 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [ { "expr": "sum(gitea_publickeys{instance=~\"$instance\"})", "refId": "A" } ],
"fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [ { "color": "blue", "value": null } ] } } }
},
{
"type": "timeseries", "title": "Динамика", "gridPos": { "h": 9, "w": 24, "x": 0, "y": 8 },
"datasource": { "type": "prometheus", "uid": "prometheus" },
"targets": [
{ "expr": "sum(gitea_repositories{instance=~\"$instance\"})", "legendFormat": "репозитории", "refId": "A" },
{ "expr": "sum(gitea_users{instance=~\"$instance\"})", "legendFormat": "пользователи", "refId": "B" },
{ "expr": "sum(gitea_issues_open{instance=~\"$instance\"})", "legendFormat": "issues открытых", "refId": "C" },
{ "expr": "sum(gitea_organizations{instance=~\"$instance\"})", "legendFormat": "организации", "refId": "D" }
],
"fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10 } } }
}
]
}