@zigordev/stack 0.0.0 → 1.1.0

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.
@@ -0,0 +1,552 @@
1
+ {
2
+ "apiVersion": "dashboard.grafana.app/v1",
3
+ "kind": "Dashboard",
4
+ "metadata": {
5
+ "name": "platform",
6
+ "annotations": {
7
+ "grafana.app/folder": "zigordev"
8
+ }
9
+ },
10
+ "spec": {
11
+ "timezone": "browser",
12
+ "editable": false,
13
+ "graphTooltip": 0,
14
+ "fiscalYearStartMonth": 0,
15
+ "schemaVersion": 42,
16
+ "templating": {},
17
+ "annotations": {},
18
+ "title": "Platform",
19
+ "uid": "platform",
20
+ "tags": [
21
+ "zigordev"
22
+ ],
23
+ "refresh": "30s",
24
+ "time": {
25
+ "from": "now-1h",
26
+ "to": "now"
27
+ },
28
+ "panels": [
29
+ {
30
+ "type": "row",
31
+ "collapsed": false,
32
+ "id": 0,
33
+ "panels": [],
34
+ "title": "The machine",
35
+ "gridPos": {
36
+ "x": 0,
37
+ "y": 0,
38
+ "h": 1,
39
+ "w": 24
40
+ }
41
+ },
42
+ {
43
+ "type": "stat",
44
+ "transparent": false,
45
+ "repeatDirection": "h",
46
+ "options": {
47
+ "graphMode": "area",
48
+ "colorMode": "value",
49
+ "justifyMode": "auto",
50
+ "textMode": "auto",
51
+ "wideLayout": true,
52
+ "showPercentChange": false,
53
+ "reduceOptions": {
54
+ "calcs": []
55
+ },
56
+ "percentChangeColorMode": "standard",
57
+ "orientation": "auto"
58
+ },
59
+ "id": 1,
60
+ "title": "Processor in use",
61
+ "datasource": {
62
+ "type": "prometheus",
63
+ "uid": "prometheus"
64
+ },
65
+ "fieldConfig": {
66
+ "defaults": {
67
+ "unit": "percentunit"
68
+ },
69
+ "overrides": []
70
+ },
71
+ "gridPos": {
72
+ "h": 4,
73
+ "w": 6,
74
+ "x": 0,
75
+ "y": 1
76
+ },
77
+ "targets": [
78
+ {
79
+ "expr": "1 - avg(rate(node_cpu_seconds_total{mode=\"idle\"}[5m]))",
80
+ "instant": true,
81
+ "range": false,
82
+ "refId": "A"
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "type": "stat",
88
+ "transparent": false,
89
+ "repeatDirection": "h",
90
+ "options": {
91
+ "graphMode": "area",
92
+ "colorMode": "value",
93
+ "justifyMode": "auto",
94
+ "textMode": "auto",
95
+ "wideLayout": true,
96
+ "showPercentChange": false,
97
+ "reduceOptions": {
98
+ "calcs": []
99
+ },
100
+ "percentChangeColorMode": "standard",
101
+ "orientation": "auto"
102
+ },
103
+ "id": 2,
104
+ "title": "Memory in use",
105
+ "datasource": {
106
+ "type": "prometheus",
107
+ "uid": "prometheus"
108
+ },
109
+ "fieldConfig": {
110
+ "defaults": {
111
+ "unit": "percentunit"
112
+ },
113
+ "overrides": []
114
+ },
115
+ "gridPos": {
116
+ "h": 4,
117
+ "w": 6,
118
+ "x": 6,
119
+ "y": 1
120
+ },
121
+ "targets": [
122
+ {
123
+ "expr": "1 - sum(node_memory_MemAvailable_bytes) / sum(node_memory_MemTotal_bytes)",
124
+ "instant": true,
125
+ "range": false,
126
+ "refId": "A"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "type": "stat",
132
+ "transparent": false,
133
+ "repeatDirection": "h",
134
+ "options": {
135
+ "graphMode": "area",
136
+ "colorMode": "value",
137
+ "justifyMode": "auto",
138
+ "textMode": "auto",
139
+ "wideLayout": true,
140
+ "showPercentChange": false,
141
+ "reduceOptions": {
142
+ "calcs": []
143
+ },
144
+ "percentChangeColorMode": "standard",
145
+ "orientation": "auto"
146
+ },
147
+ "id": 3,
148
+ "title": "Fullest disk",
149
+ "datasource": {
150
+ "type": "prometheus",
151
+ "uid": "prometheus"
152
+ },
153
+ "fieldConfig": {
154
+ "defaults": {
155
+ "unit": "percentunit"
156
+ },
157
+ "overrides": []
158
+ },
159
+ "gridPos": {
160
+ "h": 4,
161
+ "w": 6,
162
+ "x": 12,
163
+ "y": 1
164
+ },
165
+ "targets": [
166
+ {
167
+ "expr": "max(1 - max by (device) (node_filesystem_avail_bytes) / max by (device) (node_filesystem_size_bytes))",
168
+ "instant": true,
169
+ "range": false,
170
+ "refId": "A"
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "type": "stat",
176
+ "transparent": false,
177
+ "repeatDirection": "h",
178
+ "options": {
179
+ "graphMode": "area",
180
+ "colorMode": "value",
181
+ "justifyMode": "auto",
182
+ "textMode": "auto",
183
+ "wideLayout": true,
184
+ "showPercentChange": false,
185
+ "reduceOptions": {
186
+ "calcs": []
187
+ },
188
+ "percentChangeColorMode": "standard",
189
+ "orientation": "auto"
190
+ },
191
+ "id": 4,
192
+ "title": "Telemetry agents reporting",
193
+ "datasource": {
194
+ "type": "prometheus",
195
+ "uid": "prometheus"
196
+ },
197
+ "fieldConfig": {
198
+ "defaults": {
199
+ "unit": "short"
200
+ },
201
+ "overrides": []
202
+ },
203
+ "gridPos": {
204
+ "h": 4,
205
+ "w": 6,
206
+ "x": 18,
207
+ "y": 1
208
+ },
209
+ "targets": [
210
+ {
211
+ "expr": "count(alloy_build_info) or vector(0)",
212
+ "instant": true,
213
+ "range": false,
214
+ "refId": "A"
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ "type": "timeseries",
220
+ "transparent": false,
221
+ "repeatDirection": "h",
222
+ "options": {
223
+ "legend": {
224
+ "displayMode": "list",
225
+ "placement": "bottom",
226
+ "showLegend": false,
227
+ "calcs": []
228
+ },
229
+ "tooltip": {
230
+ "mode": "single",
231
+ "sort": "asc"
232
+ }
233
+ },
234
+ "fieldConfig": {
235
+ "defaults": {
236
+ "custom": {},
237
+ "unit": "percentunit"
238
+ },
239
+ "overrides": []
240
+ },
241
+ "id": 5,
242
+ "title": "Processor and memory in use",
243
+ "datasource": {
244
+ "type": "prometheus",
245
+ "uid": "prometheus"
246
+ },
247
+ "gridPos": {
248
+ "h": 8,
249
+ "w": 12,
250
+ "x": 0,
251
+ "y": 5
252
+ },
253
+ "targets": [
254
+ {
255
+ "expr": "1 - avg(rate(node_cpu_seconds_total{mode=\"idle\"}[5m]))",
256
+ "legendFormat": "processor",
257
+ "refId": "A"
258
+ },
259
+ {
260
+ "expr": "1 - sum(node_memory_MemAvailable_bytes) / sum(node_memory_MemTotal_bytes)",
261
+ "legendFormat": "memory",
262
+ "refId": "B"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "type": "timeseries",
268
+ "transparent": false,
269
+ "repeatDirection": "h",
270
+ "options": {
271
+ "legend": {
272
+ "displayMode": "list",
273
+ "placement": "bottom",
274
+ "showLegend": false,
275
+ "calcs": []
276
+ },
277
+ "tooltip": {
278
+ "mode": "single",
279
+ "sort": "asc"
280
+ }
281
+ },
282
+ "fieldConfig": {
283
+ "defaults": {
284
+ "custom": {},
285
+ "unit": "percentunit"
286
+ },
287
+ "overrides": []
288
+ },
289
+ "id": 6,
290
+ "title": "Disk in use",
291
+ "datasource": {
292
+ "type": "prometheus",
293
+ "uid": "prometheus"
294
+ },
295
+ "gridPos": {
296
+ "h": 8,
297
+ "w": 12,
298
+ "x": 12,
299
+ "y": 5
300
+ },
301
+ "targets": [
302
+ {
303
+ "expr": "1 - max by (device) (node_filesystem_avail_bytes) / max by (device) (node_filesystem_size_bytes)",
304
+ "legendFormat": "{{device}}",
305
+ "refId": "A"
306
+ }
307
+ ]
308
+ },
309
+ {
310
+ "type": "row",
311
+ "collapsed": false,
312
+ "id": 0,
313
+ "panels": [],
314
+ "title": "The ingress",
315
+ "gridPos": {
316
+ "x": 0,
317
+ "y": 13,
318
+ "h": 1,
319
+ "w": 24
320
+ }
321
+ },
322
+ {
323
+ "type": "timeseries",
324
+ "transparent": false,
325
+ "repeatDirection": "h",
326
+ "options": {
327
+ "legend": {
328
+ "displayMode": "list",
329
+ "placement": "bottom",
330
+ "showLegend": false,
331
+ "calcs": []
332
+ },
333
+ "tooltip": {
334
+ "mode": "single",
335
+ "sort": "asc"
336
+ }
337
+ },
338
+ "fieldConfig": {
339
+ "defaults": {
340
+ "custom": {},
341
+ "unit": "reqps"
342
+ },
343
+ "overrides": []
344
+ },
345
+ "id": 7,
346
+ "title": "Requests by destination",
347
+ "datasource": {
348
+ "type": "prometheus",
349
+ "uid": "prometheus"
350
+ },
351
+ "gridPos": {
352
+ "h": 8,
353
+ "w": 12,
354
+ "x": 0,
355
+ "y": 14
356
+ },
357
+ "targets": [
358
+ {
359
+ "expr": "sum by (service) (rate(traefik_service_requests_total[$__rate_interval]))",
360
+ "legendFormat": "{{service}}",
361
+ "refId": "A"
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "type": "timeseries",
367
+ "transparent": false,
368
+ "repeatDirection": "h",
369
+ "options": {
370
+ "legend": {
371
+ "displayMode": "list",
372
+ "placement": "bottom",
373
+ "showLegend": false,
374
+ "calcs": []
375
+ },
376
+ "tooltip": {
377
+ "mode": "single",
378
+ "sort": "asc"
379
+ }
380
+ },
381
+ "fieldConfig": {
382
+ "defaults": {
383
+ "custom": {},
384
+ "unit": "percentunit"
385
+ },
386
+ "overrides": []
387
+ },
388
+ "id": 8,
389
+ "title": "Share of requests that fail, by destination",
390
+ "datasource": {
391
+ "type": "prometheus",
392
+ "uid": "prometheus"
393
+ },
394
+ "gridPos": {
395
+ "h": 8,
396
+ "w": 12,
397
+ "x": 12,
398
+ "y": 14
399
+ },
400
+ "targets": [
401
+ {
402
+ "expr": "sum by (service) (rate(traefik_service_requests_total{code=~\"5..\"}[$__rate_interval])) / sum by (service) (rate(traefik_service_requests_total[$__rate_interval]))",
403
+ "legendFormat": "{{service}}",
404
+ "refId": "A"
405
+ }
406
+ ]
407
+ },
408
+ {
409
+ "type": "timeseries",
410
+ "transparent": false,
411
+ "repeatDirection": "h",
412
+ "options": {
413
+ "legend": {
414
+ "displayMode": "list",
415
+ "placement": "bottom",
416
+ "showLegend": false,
417
+ "calcs": []
418
+ },
419
+ "tooltip": {
420
+ "mode": "single",
421
+ "sort": "asc"
422
+ }
423
+ },
424
+ "fieldConfig": {
425
+ "defaults": {
426
+ "custom": {},
427
+ "unit": "s"
428
+ },
429
+ "overrides": []
430
+ },
431
+ "id": 9,
432
+ "title": "Response time of the slowest 5%, by destination",
433
+ "datasource": {
434
+ "type": "prometheus",
435
+ "uid": "prometheus"
436
+ },
437
+ "gridPos": {
438
+ "h": 8,
439
+ "w": 12,
440
+ "x": 0,
441
+ "y": 22
442
+ },
443
+ "targets": [
444
+ {
445
+ "expr": "histogram_quantile(0.95, sum by (service, le) (rate(traefik_service_request_duration_seconds_bucket[$__rate_interval])))",
446
+ "legendFormat": "{{service}}",
447
+ "refId": "A"
448
+ }
449
+ ]
450
+ },
451
+ {
452
+ "type": "row",
453
+ "collapsed": false,
454
+ "id": 0,
455
+ "panels": [],
456
+ "title": "Telemetry",
457
+ "gridPos": {
458
+ "x": 0,
459
+ "y": 30,
460
+ "h": 1,
461
+ "w": 24
462
+ }
463
+ },
464
+ {
465
+ "type": "timeseries",
466
+ "transparent": false,
467
+ "repeatDirection": "h",
468
+ "options": {
469
+ "legend": {
470
+ "displayMode": "list",
471
+ "placement": "bottom",
472
+ "showLegend": false,
473
+ "calcs": []
474
+ },
475
+ "tooltip": {
476
+ "mode": "single",
477
+ "sort": "asc"
478
+ }
479
+ },
480
+ "fieldConfig": {
481
+ "defaults": {
482
+ "custom": {},
483
+ "unit": "short"
484
+ },
485
+ "overrides": []
486
+ },
487
+ "id": 10,
488
+ "title": "Who is reporting",
489
+ "datasource": {
490
+ "type": "prometheus",
491
+ "uid": "prometheus"
492
+ },
493
+ "gridPos": {
494
+ "h": 8,
495
+ "w": 12,
496
+ "x": 0,
497
+ "y": 31
498
+ },
499
+ "targets": [
500
+ {
501
+ "expr": "count by (service_name) (target_info)",
502
+ "legendFormat": "{{service_name}}",
503
+ "refId": "A"
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ "type": "timeseries",
509
+ "transparent": false,
510
+ "repeatDirection": "h",
511
+ "options": {
512
+ "legend": {
513
+ "displayMode": "list",
514
+ "placement": "bottom",
515
+ "showLegend": false,
516
+ "calcs": []
517
+ },
518
+ "tooltip": {
519
+ "mode": "single",
520
+ "sort": "asc"
521
+ }
522
+ },
523
+ "fieldConfig": {
524
+ "defaults": {
525
+ "custom": {},
526
+ "unit": "short"
527
+ },
528
+ "overrides": []
529
+ },
530
+ "id": 11,
531
+ "title": "Log lines by service",
532
+ "datasource": {
533
+ "type": "loki",
534
+ "uid": "loki"
535
+ },
536
+ "gridPos": {
537
+ "h": 8,
538
+ "w": 12,
539
+ "x": 12,
540
+ "y": 31
541
+ },
542
+ "targets": [
543
+ {
544
+ "expr": "sum by (service_name) (count_over_time({service_name=~\".+\"}[$__auto]))",
545
+ "legendFormat": "{{service_name}}",
546
+ "refId": "A"
547
+ }
548
+ ]
549
+ }
550
+ ]
551
+ }
552
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "apiVersion": "folder.grafana.app/v1",
3
+ "kind": "Folder",
4
+ "metadata": {
5
+ "name": "zigordev"
6
+ },
7
+ "spec": {
8
+ "title": "zigordev"
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,10 +1,37 @@
1
1
  {
2
2
  "name": "@zigordev/stack",
3
- "version": "0.0.0",
4
- "description": "The first, empty version of this package. The pipeline of zigordev/platform publishes every later one.",
3
+ "version": "1.1.0",
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
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=26"
9
+ },
10
+ "bin": {
11
+ "zigordev-stack": "./bin/zigordev-stack.js"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "dist",
16
+ "compose.yaml",
17
+ "compose.local.yaml",
18
+ "observability"
19
+ ],
20
+ "devDependencies": {
21
+ "@types/node": "26.6.6",
22
+ "typescript": "7.0.2",
23
+ "vitest": "5.1.1"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
6
28
  "repository": {
7
29
  "type": "git",
8
- "url": "git+https://github.com/zigordev/platform.git"
30
+ "url": "git+https://github.com/zigordev/platform.git",
31
+ "directory": "stack"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc -p tsconfig.build.json",
35
+ "typecheck": "tsc -p tsconfig.json"
9
36
  }
10
- }
37
+ }