@zigordev/stack 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -85,13 +85,13 @@ The three mounts let the agent read the machine's numbers. It runs as a user tha
|
|
|
85
85
|
|
|
86
86
|
### Dashboards and alert rules
|
|
87
87
|
|
|
88
|
-
`zigordev-stack up` ends by pushing
|
|
88
|
+
`zigordev-stack up` ends by pushing nine files to the local Grafana, with gcx: one folder, two dashboards and six alert rules. A second push changes nothing.
|
|
89
89
|
|
|
90
|
-
| In Grafana | What it shows
|
|
91
|
-
| --------------------------------------- |
|
|
92
|
-
| Dashboards, folder `zigordev`, App | One app, picked from a list: whether it reports, its version, its requests, the share that fail, its response times, its events and its errors
|
|
93
|
-
| Dashboards, folder `zigordev`, Platform | The machine's processor, memory and disks, the requests at the ingress,
|
|
94
|
-
| Alerting,
|
|
90
|
+
| In Grafana | What it shows |
|
|
91
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| Dashboards, folder `zigordev`, App | One app, picked from a list: whether it reports, its version, its requests, the share that fail, its response times, its events and its errors |
|
|
93
|
+
| Dashboards, folder `zigordev`, Platform | The machine's processor, memory and disks, the requests at the ingress, who is reporting, and how old each product's newest dump and last good restore test are |
|
|
94
|
+
| Alerting, six rules | [The runbooks](../docs/runbooks/README.md) list them. On the laptop they show in Grafana and notify nobody |
|
|
95
95
|
|
|
96
96
|
A new app needs no entry anywhere. It appears in the list of the App dashboard with its first request, and every rule covers it.
|
|
97
97
|
|
package/compose.yaml
CHANGED
|
@@ -30,7 +30,7 @@ services:
|
|
|
30
30
|
networks: [docker]
|
|
31
31
|
|
|
32
32
|
traefik:
|
|
33
|
-
image: traefik:v3.
|
|
33
|
+
image: traefik:v3.8.0@sha256:00c9734983e74ae35a1fc18eaee9e9da13f3dde95c4e45b3b8c3b60e0dbd2d17
|
|
34
34
|
user: "65532:65532"
|
|
35
35
|
init: true
|
|
36
36
|
read_only: true
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": "rules.alerting.grafana.app/v1beta1",
|
|
3
|
+
"kind": "AlertRule",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "backup-is-too-old",
|
|
6
|
+
"annotations": {
|
|
7
|
+
"grafana.app/folder": "zigordev"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"spec": {
|
|
11
|
+
"title": "A backup is too old",
|
|
12
|
+
"trigger": {
|
|
13
|
+
"interval": "1m"
|
|
14
|
+
},
|
|
15
|
+
"for": "5m",
|
|
16
|
+
"noDataState": "Ok",
|
|
17
|
+
"execErrState": "Error",
|
|
18
|
+
"labels": {
|
|
19
|
+
"severity": "email"
|
|
20
|
+
},
|
|
21
|
+
"annotations": {
|
|
22
|
+
"summary": "The newest dump of {{ $labels.compose_project }} is more than 2 hours old, so more than an hour of its data could be lost",
|
|
23
|
+
"runbook_url": "https://github.com/zigordev/platform/blob/main/docs/runbooks/backup-is-too-old.md",
|
|
24
|
+
"__dashboardUid__": "platform",
|
|
25
|
+
"__panelId__": "12"
|
|
26
|
+
},
|
|
27
|
+
"expressions": {
|
|
28
|
+
"A": {
|
|
29
|
+
"datasourceUID": "prometheus",
|
|
30
|
+
"relativeTimeRange": {
|
|
31
|
+
"from": "10m",
|
|
32
|
+
"to": "0s"
|
|
33
|
+
},
|
|
34
|
+
"model": {
|
|
35
|
+
"refId": "A",
|
|
36
|
+
"expr": "(time() - max by (compose_project) (platform_backup_last_success_timestamp_seconds)) > 7200",
|
|
37
|
+
"instant": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"B": {
|
|
41
|
+
"source": true,
|
|
42
|
+
"model": {
|
|
43
|
+
"refId": "B",
|
|
44
|
+
"type": "threshold",
|
|
45
|
+
"expression": "A",
|
|
46
|
+
"conditions": [
|
|
47
|
+
{
|
|
48
|
+
"evaluator": {
|
|
49
|
+
"type": "gt",
|
|
50
|
+
"params": [
|
|
51
|
+
0
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": "rules.alerting.grafana.app/v1beta1",
|
|
3
|
+
"kind": "AlertRule",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "restore-test-is-too-old",
|
|
6
|
+
"annotations": {
|
|
7
|
+
"grafana.app/folder": "zigordev"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"spec": {
|
|
11
|
+
"title": "A restore test is too old",
|
|
12
|
+
"trigger": {
|
|
13
|
+
"interval": "1m"
|
|
14
|
+
},
|
|
15
|
+
"for": "0s",
|
|
16
|
+
"noDataState": "Ok",
|
|
17
|
+
"execErrState": "Error",
|
|
18
|
+
"labels": {
|
|
19
|
+
"severity": "email"
|
|
20
|
+
},
|
|
21
|
+
"annotations": {
|
|
22
|
+
"summary": "The last good restore test of {{ $labels.compose_project }} is more than 35 days old, so nobody knows whether its dumps restore",
|
|
23
|
+
"runbook_url": "https://github.com/zigordev/platform/blob/main/docs/runbooks/restore-test-is-too-old.md",
|
|
24
|
+
"__dashboardUid__": "platform",
|
|
25
|
+
"__panelId__": "13"
|
|
26
|
+
},
|
|
27
|
+
"expressions": {
|
|
28
|
+
"A": {
|
|
29
|
+
"datasourceUID": "prometheus",
|
|
30
|
+
"relativeTimeRange": {
|
|
31
|
+
"from": "10m",
|
|
32
|
+
"to": "0s"
|
|
33
|
+
},
|
|
34
|
+
"model": {
|
|
35
|
+
"refId": "A",
|
|
36
|
+
"expr": "(time() - max by (compose_project) (platform_restore_test_last_success_timestamp_seconds)) > 3024000",
|
|
37
|
+
"instant": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"B": {
|
|
41
|
+
"source": true,
|
|
42
|
+
"model": {
|
|
43
|
+
"refId": "B",
|
|
44
|
+
"type": "threshold",
|
|
45
|
+
"expression": "A",
|
|
46
|
+
"conditions": [
|
|
47
|
+
{
|
|
48
|
+
"evaluator": {
|
|
49
|
+
"type": "gt",
|
|
50
|
+
"params": [
|
|
51
|
+
0
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -546,6 +546,105 @@
|
|
|
546
546
|
"refId": "A"
|
|
547
547
|
}
|
|
548
548
|
]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"type": "row",
|
|
552
|
+
"collapsed": false,
|
|
553
|
+
"id": 0,
|
|
554
|
+
"panels": [],
|
|
555
|
+
"title": "Backups",
|
|
556
|
+
"gridPos": {
|
|
557
|
+
"x": 0,
|
|
558
|
+
"y": 39,
|
|
559
|
+
"h": 1,
|
|
560
|
+
"w": 24
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"type": "timeseries",
|
|
565
|
+
"transparent": false,
|
|
566
|
+
"repeatDirection": "h",
|
|
567
|
+
"options": {
|
|
568
|
+
"legend": {
|
|
569
|
+
"displayMode": "list",
|
|
570
|
+
"placement": "bottom",
|
|
571
|
+
"showLegend": false,
|
|
572
|
+
"calcs": []
|
|
573
|
+
},
|
|
574
|
+
"tooltip": {
|
|
575
|
+
"mode": "single",
|
|
576
|
+
"sort": "asc"
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
"fieldConfig": {
|
|
580
|
+
"defaults": {
|
|
581
|
+
"custom": {},
|
|
582
|
+
"unit": "s"
|
|
583
|
+
},
|
|
584
|
+
"overrides": []
|
|
585
|
+
},
|
|
586
|
+
"id": 12,
|
|
587
|
+
"title": "Age of the newest dump, by product",
|
|
588
|
+
"datasource": {
|
|
589
|
+
"type": "prometheus",
|
|
590
|
+
"uid": "prometheus"
|
|
591
|
+
},
|
|
592
|
+
"gridPos": {
|
|
593
|
+
"h": 8,
|
|
594
|
+
"w": 12,
|
|
595
|
+
"x": 0,
|
|
596
|
+
"y": 40
|
|
597
|
+
},
|
|
598
|
+
"targets": [
|
|
599
|
+
{
|
|
600
|
+
"expr": "time() - max by (compose_project) (platform_backup_last_success_timestamp_seconds)",
|
|
601
|
+
"legendFormat": "{{compose_project}}",
|
|
602
|
+
"refId": "A"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"type": "timeseries",
|
|
608
|
+
"transparent": false,
|
|
609
|
+
"repeatDirection": "h",
|
|
610
|
+
"options": {
|
|
611
|
+
"legend": {
|
|
612
|
+
"displayMode": "list",
|
|
613
|
+
"placement": "bottom",
|
|
614
|
+
"showLegend": false,
|
|
615
|
+
"calcs": []
|
|
616
|
+
},
|
|
617
|
+
"tooltip": {
|
|
618
|
+
"mode": "single",
|
|
619
|
+
"sort": "asc"
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
"fieldConfig": {
|
|
623
|
+
"defaults": {
|
|
624
|
+
"custom": {},
|
|
625
|
+
"unit": "s"
|
|
626
|
+
},
|
|
627
|
+
"overrides": []
|
|
628
|
+
},
|
|
629
|
+
"id": 13,
|
|
630
|
+
"title": "Age of the last good restore test, by product",
|
|
631
|
+
"datasource": {
|
|
632
|
+
"type": "prometheus",
|
|
633
|
+
"uid": "prometheus"
|
|
634
|
+
},
|
|
635
|
+
"gridPos": {
|
|
636
|
+
"h": 8,
|
|
637
|
+
"w": 12,
|
|
638
|
+
"x": 12,
|
|
639
|
+
"y": 40
|
|
640
|
+
},
|
|
641
|
+
"targets": [
|
|
642
|
+
{
|
|
643
|
+
"expr": "time() - max by (compose_project) (platform_restore_test_last_success_timestamp_seconds)",
|
|
644
|
+
"legendFormat": "{{compose_project}}",
|
|
645
|
+
"refId": "A"
|
|
646
|
+
}
|
|
647
|
+
]
|
|
549
648
|
}
|
|
550
649
|
]
|
|
551
650
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zigordev/stack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "The shared services of the zigordev platform for a laptop: the ingress, the telemetry agent, a local Grafana and a mail catcher, as compose files with one command that starts them",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|