working json

This commit is contained in:
Henry Hiles 2025-10-29 15:24:57 -04:00
commit dfe7918cdb
No known key found for this signature in database
2 changed files with 198 additions and 2 deletions

View file

@ -43,12 +43,30 @@ in
{
name = "Prometheus";
type = "prometheus";
uid = "prometheus";
url = with config.services.prometheus; "http://${listenAddress}:${toString port}";
jsonData.timeInterval = config.services.prometheus.globalConfig.scrape_interval;
}
];
dashboards.settings.providers = [
{
name = "Status";
options.path = (import ../../../lib/status.nix { inherit pkgs; }) [
{
name = "Continuwuity (Matrix)";
service = "continuwuity.service";
}
{
name = "Forgejo (Git)";
service = "forgejo.service";
}
{
name = "SearXNG (Search)";
service = "searx.service";
}
];
}
{
name = "Node exporter";
options.path = pkgs.fetchurl {
@ -60,8 +78,10 @@ in
];
};
};
caddy.virtualHosts."${domain}".extraConfig =
"reverse_proxy unix/${config.services.grafana.settings.server.socket}";
caddy.virtualHosts."${domain}".extraConfig = ''
redir / /public-dashboards/cf91b463711b401b8bf6336125f70cd3
reverse_proxy unix/${config.services.grafana.settings.server.socket}
'';
};
users.users.caddy.extraGroups = [ "grafana" ];

View file

@ -0,0 +1,176 @@
{
"annotations": {
"list": []
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{
"options": {
"1": {
"color": "green",
"index": 0,
"text": "Running"
},
"0": {
"color": "red",
"index": 1,
"text": "Failed"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "value"
},
"pluginVersion": "11.2.0",
"targets": [
{
"expr": "node_systemd_unit_state{name=\"continuwuity.service\",state=\"active\"}",
"legendFormat": "Matrix",
"refId": "A"
}
],
"title": "Matrix",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{
"options": {
"1": {
"color": "green",
"index": 0,
"text": "Running"
},
"0": {
"color": "red",
"index": 1,
"text": "Failed"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 6,
"y": 0
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "value"
},
"pluginVersion": "11.2.0",
"targets": [
{
"expr": "node_systemd_unit_state{name=\"forgejo.service\",state=\"active\"}",
"legendFormat": "Forgejo (Git)",
"refId": "A"
}
],
"title": "Forgejo (Git)",
"type": "stat"
}
],
"refresh": "10s",
"schemaVersion": 39,
"style": "dark",
"tags": ["systemd", "status"],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timezone": "",
"title": "Service Status Dashboard",
"uid": "service-status-dashboard",
"version": 1,
"weekStart": ""
}