repos / ops

infra for pico services
git clone https://github.com/picosh/ops.git

commit
50c651a
parent
5d351f6
author
Antonio Mika
date
2024-08-27 03:25:15 +0000 UTC
Update sizing
1 files changed,  +208, -208
M monitoring/grafana/config/provisioning/dashboards/tuns.json
+208, -208
  1@@ -76,18 +76,17 @@
  2                 "value": 80
  3               }
  4             ]
  5-          },
  6-          "unit": "bytes"
  7+          }
  8         },
  9         "overrides": []
 10       },
 11       "gridPos": {
 12-        "h": 5,
 13-        "w": 24,
 14+        "h": 10,
 15+        "w": 12,
 16         "x": 0,
 17         "y": 0
 18       },
 19-      "id": 9,
 20+      "id": 1,
 21       "options": {
 22         "legend": {
 23           "calcs": [
 24@@ -113,27 +112,14 @@
 25             "uid": "PBFA97CFB590B2093"
 26           },
 27           "editorMode": "code",
 28-          "expr": "rate(process_network_receive_bytes_total{job=\"tuns\"}[$__rate_interval])",
 29+          "expr": "sish_connections_total",
 30           "instant": false,
 31-          "legendFormat": "RX",
 32+          "legendFormat": "Total Connections",
 33           "range": true,
 34           "refId": "A"
 35-        },
 36-        {
 37-          "datasource": {
 38-            "type": "prometheus",
 39-            "uid": "PBFA97CFB590B2093"
 40-          },
 41-          "editorMode": "code",
 42-          "expr": "rate(process_network_transmit_bytes_total{job=\"tuns\"}[$__rate_interval])",
 43-          "hide": false,
 44-          "instant": false,
 45-          "legendFormat": "TX",
 46-          "range": true,
 47-          "refId": "B"
 48         }
 49       ],
 50-      "title": "Network Usage",
 51+      "title": "Total Connections",
 52       "type": "timeseries"
 53     },
 54     {
 55@@ -191,18 +177,17 @@
 56                 "value": 80
 57               }
 58             ]
 59-          },
 60-          "unit": "percentunit"
 61+          }
 62         },
 63         "overrides": []
 64       },
 65       "gridPos": {
 66-        "h": 8,
 67+        "h": 10,
 68         "w": 12,
 69-        "x": 0,
 70-        "y": 5
 71+        "x": 12,
 72+        "y": 0
 73       },
 74-      "id": 7,
 75+      "id": 2,
 76       "options": {
 77         "legend": {
 78           "calcs": [
 79@@ -228,14 +213,53 @@
 80             "uid": "PBFA97CFB590B2093"
 81           },
 82           "editorMode": "code",
 83-          "expr": "rate(process_cpu_seconds_total{job=\"tuns\"}[$__rate_interval])",
 84+          "expr": "sum(sish_tunnels_active{type=\"alias\"}) or vector(0)",
 85           "instant": false,
 86-          "legendFormat": "CPU Usage",
 87+          "legendFormat": "Alias",
 88           "range": true,
 89           "refId": "A"
 90+        },
 91+        {
 92+          "datasource": {
 93+            "type": "prometheus",
 94+            "uid": "PBFA97CFB590B2093"
 95+          },
 96+          "editorMode": "code",
 97+          "expr": "sum(sish_tunnels_active{type=\"tcp\"}) or vector(0)",
 98+          "hide": false,
 99+          "instant": false,
100+          "legendFormat": "TCP",
101+          "range": true,
102+          "refId": "B"
103+        },
104+        {
105+          "datasource": {
106+            "type": "prometheus",
107+            "uid": "PBFA97CFB590B2093"
108+          },
109+          "editorMode": "code",
110+          "expr": "sum(sish_tunnels_active{type=\"http\"}) or vector(0)",
111+          "hide": false,
112+          "instant": false,
113+          "legendFormat": "HTTP",
114+          "range": true,
115+          "refId": "C"
116+        },
117+        {
118+          "datasource": {
119+            "type": "prometheus",
120+            "uid": "PBFA97CFB590B2093"
121+          },
122+          "editorMode": "code",
123+          "expr": "sum(sish_tunnels_active{type=\"process\"}) or vector(0)",
124+          "hide": false,
125+          "instant": false,
126+          "legendFormat": "Process",
127+          "range": true,
128+          "refId": "D"
129         }
130       ],
131-      "title": "CPU Usage",
132+      "title": "Tunnels Count",
133       "type": "timeseries"
134     },
135     {
136@@ -294,17 +318,17 @@
137               }
138             ]
139           },
140-          "unit": "bytes"
141+          "unit": "s"
142         },
143         "overrides": []
144       },
145       "gridPos": {
146-        "h": 8,
147+        "h": 11,
148         "w": 12,
149-        "x": 12,
150-        "y": 5
151+        "x": 0,
152+        "y": 10
153       },
154-      "id": 6,
155+      "id": 3,
156       "options": {
157         "legend": {
158           "calcs": [
159@@ -330,16 +354,117 @@
160             "uid": "PBFA97CFB590B2093"
161           },
162           "editorMode": "code",
163-          "expr": "process_resident_memory_bytes{job=\"tuns\"}",
164+          "expr": "time() - sish_connections_time",
165           "instant": false,
166-          "legendFormat": "Memory",
167+          "legendFormat": "{{user}} - {{connection}}",
168           "range": true,
169           "refId": "A"
170         }
171       ],
172-      "title": "Memory Usage",
173+      "title": "Session Duration",
174       "type": "timeseries"
175     },
176+    {
177+      "datasource": {
178+        "type": "prometheus",
179+        "uid": "PBFA97CFB590B2093"
180+      },
181+      "fieldConfig": {
182+        "defaults": {
183+          "color": {
184+            "mode": "thresholds"
185+          },
186+          "custom": {
187+            "align": "auto",
188+            "cellOptions": {
189+              "type": "auto"
190+            },
191+            "filterable": false,
192+            "inspect": false
193+          },
194+          "mappings": [],
195+          "thresholds": {
196+            "mode": "absolute",
197+            "steps": [
198+              {
199+                "color": "green",
200+                "value": null
201+              },
202+              {
203+                "color": "red",
204+                "value": 80
205+              }
206+            ]
207+          }
208+        },
209+        "overrides": []
210+      },
211+      "gridPos": {
212+        "h": 11,
213+        "w": 12,
214+        "x": 12,
215+        "y": 10
216+      },
217+      "id": 8,
218+      "options": {
219+        "cellHeight": "sm",
220+        "footer": {
221+          "countRows": false,
222+          "fields": "",
223+          "reducer": [
224+            "sum"
225+          ],
226+          "show": false
227+        },
228+        "showHeader": true
229+      },
230+      "pluginVersion": "10.2.2",
231+      "targets": [
232+        {
233+          "datasource": {
234+            "type": "prometheus",
235+            "uid": "PBFA97CFB590B2093"
236+          },
237+          "editorMode": "code",
238+          "exemplar": false,
239+          "expr": "sish_tunnels_active",
240+          "format": "table",
241+          "instant": true,
242+          "legendFormat": "__auto",
243+          "range": false,
244+          "refId": "A"
245+        }
246+      ],
247+      "title": "Tunnels",
248+      "transformations": [
249+        {
250+          "id": "organize",
251+          "options": {
252+            "excludeByName": {
253+              "Time": true,
254+              "Value": true,
255+              "__name__": true,
256+              "instance": true,
257+              "job": true
258+            },
259+            "indexByName": {
260+              "Time": 0,
261+              "Value": 9,
262+              "__name__": 1,
263+              "connection": 3,
264+              "instance": 5,
265+              "job": 6,
266+              "tunnel": 7,
267+              "type": 4,
268+              "unix": 8,
269+              "user": 2
270+            },
271+            "renameByName": {}
272+          }
273+        }
274+      ],
275+      "type": "table"
276+    },
277     {
278       "datasource": {
279         "type": "prometheus",
280@@ -396,17 +521,17 @@
281               }
282             ]
283           },
284-          "unit": "none"
285+          "unit": "percentunit"
286         },
287         "overrides": []
288       },
289       "gridPos": {
290-        "h": 8,
291+        "h": 11,
292         "w": 12,
293         "x": 0,
294-        "y": 13
295+        "y": 21
296       },
297-      "id": 5,
298+      "id": 7,
299       "options": {
300         "legend": {
301           "calcs": [
302@@ -432,15 +557,14 @@
303             "uid": "PBFA97CFB590B2093"
304           },
305           "editorMode": "code",
306-          "expr": "process_open_fds{job=\"tuns\"}",
307-          "hide": false,
308+          "expr": "rate(process_cpu_seconds_total{job=\"tuns\"}[$__rate_interval])",
309           "instant": false,
310-          "legendFormat": "Fds",
311+          "legendFormat": "CPU Usage",
312           "range": true,
313-          "refId": "B"
314+          "refId": "A"
315         }
316       ],
317-      "title": "Open Fds",
318+      "title": "CPU Usage",
319       "type": "timeseries"
320     },
321     {
322@@ -498,17 +622,18 @@
323                 "value": 80
324               }
325             ]
326-          }
327+          },
328+          "unit": "bytes"
329         },
330         "overrides": []
331       },
332       "gridPos": {
333-        "h": 8,
334+        "h": 11,
335         "w": 12,
336         "x": 12,
337-        "y": 13
338+        "y": 21
339       },
340-      "id": 4,
341+      "id": 6,
342       "options": {
343         "legend": {
344           "calcs": [
345@@ -534,14 +659,14 @@
346             "uid": "PBFA97CFB590B2093"
347           },
348           "editorMode": "code",
349-          "expr": "go_goroutines{job=\"tuns\"}",
350+          "expr": "process_resident_memory_bytes{job=\"tuns\"}",
351           "instant": false,
352-          "legendFormat": "Goroutines",
353+          "legendFormat": "Memory",
354           "range": true,
355           "refId": "A"
356         }
357       ],
358-      "title": "Goroutines",
359+      "title": "Memory Usage",
360       "type": "timeseries"
361     },
362     {
363@@ -599,17 +724,18 @@
364                 "value": 80
365               }
366             ]
367-          }
368+          },
369+          "unit": "none"
370         },
371         "overrides": []
372       },
373       "gridPos": {
374-        "h": 8,
375+        "h": 11,
376         "w": 12,
377         "x": 0,
378-        "y": 21
379+        "y": 32
380       },
381-      "id": 1,
382+      "id": 5,
383       "options": {
384         "legend": {
385           "calcs": [
386@@ -635,14 +761,15 @@
387             "uid": "PBFA97CFB590B2093"
388           },
389           "editorMode": "code",
390-          "expr": "sish_connections_total",
391+          "expr": "process_open_fds{job=\"tuns\"}",
392+          "hide": false,
393           "instant": false,
394-          "legendFormat": "Total Connections",
395+          "legendFormat": "Fds",
396           "range": true,
397-          "refId": "A"
398+          "refId": "B"
399         }
400       ],
401-      "title": "Total Connections",
402+      "title": "Open Fds",
403       "type": "timeseries"
404     },
405     {
406@@ -700,18 +827,17 @@
407                 "value": 80
408               }
409             ]
410-          },
411-          "unit": "s"
412+          }
413         },
414         "overrides": []
415       },
416       "gridPos": {
417-        "h": 8,
418+        "h": 11,
419         "w": 12,
420         "x": 12,
421-        "y": 21
422+        "y": 32
423       },
424-      "id": 3,
425+      "id": 4,
426       "options": {
427         "legend": {
428           "calcs": [
429@@ -737,14 +863,14 @@
430             "uid": "PBFA97CFB590B2093"
431           },
432           "editorMode": "code",
433-          "expr": "time() - sish_connections_time",
434+          "expr": "go_goroutines{job=\"tuns\"}",
435           "instant": false,
436-          "legendFormat": "{{user}} - {{connection}}",
437+          "legendFormat": "Goroutines",
438           "range": true,
439           "refId": "A"
440         }
441       ],
442-      "title": "Session Duration",
443+      "title": "Goroutines",
444       "type": "timeseries"
445     },
446     {
447@@ -802,17 +928,18 @@
448                 "value": 80
449               }
450             ]
451-          }
452+          },
453+          "unit": "bytes"
454         },
455         "overrides": []
456       },
457       "gridPos": {
458-        "h": 8,
459-        "w": 12,
460+        "h": 10,
461+        "w": 24,
462         "x": 0,
463-        "y": 29
464+        "y": 43
465       },
466-      "id": 2,
467+      "id": 9,
468       "options": {
469         "legend": {
470           "calcs": [
471@@ -838,9 +965,9 @@
472             "uid": "PBFA97CFB590B2093"
473           },
474           "editorMode": "code",
475-          "expr": "sum(sish_tunnels_active{type=\"alias\"}) or vector(0)",
476+          "expr": "rate(process_network_receive_bytes_total{job=\"tuns\"}[$__rate_interval])",
477           "instant": false,
478-          "legendFormat": "Alias",
479+          "legendFormat": "RX",
480           "range": true,
481           "refId": "A"
482         },
483@@ -850,143 +977,16 @@
484             "uid": "PBFA97CFB590B2093"
485           },
486           "editorMode": "code",
487-          "expr": "sum(sish_tunnels_active{type=\"tcp\"}) or vector(0)",
488+          "expr": "rate(process_network_transmit_bytes_total{job=\"tuns\"}[$__rate_interval])",
489           "hide": false,
490           "instant": false,
491-          "legendFormat": "TCP",
492+          "legendFormat": "TX",
493           "range": true,
494           "refId": "B"
495-        },
496-        {
497-          "datasource": {
498-            "type": "prometheus",
499-            "uid": "PBFA97CFB590B2093"
500-          },
501-          "editorMode": "code",
502-          "expr": "sum(sish_tunnels_active{type=\"http\"}) or vector(0)",
503-          "hide": false,
504-          "instant": false,
505-          "legendFormat": "HTTP",
506-          "range": true,
507-          "refId": "C"
508-        },
509-        {
510-          "datasource": {
511-            "type": "prometheus",
512-            "uid": "PBFA97CFB590B2093"
513-          },
514-          "editorMode": "code",
515-          "expr": "sum(sish_tunnels_active{type=\"process\"}) or vector(0)",
516-          "hide": false,
517-          "instant": false,
518-          "legendFormat": "Process",
519-          "range": true,
520-          "refId": "D"
521         }
522       ],
523-      "title": "Tunnels Count",
524+      "title": "Network Usage",
525       "type": "timeseries"
526-    },
527-    {
528-      "datasource": {
529-        "type": "prometheus",
530-        "uid": "PBFA97CFB590B2093"
531-      },
532-      "fieldConfig": {
533-        "defaults": {
534-          "color": {
535-            "mode": "thresholds"
536-          },
537-          "custom": {
538-            "align": "auto",
539-            "cellOptions": {
540-              "type": "auto"
541-            },
542-            "filterable": false,
543-            "inspect": false
544-          },
545-          "mappings": [],
546-          "thresholds": {
547-            "mode": "absolute",
548-            "steps": [
549-              {
550-                "color": "green",
551-                "value": null
552-              },
553-              {
554-                "color": "red",
555-                "value": 80
556-              }
557-            ]
558-          }
559-        },
560-        "overrides": []
561-      },
562-      "gridPos": {
563-        "h": 8,
564-        "w": 12,
565-        "x": 12,
566-        "y": 29
567-      },
568-      "id": 8,
569-      "options": {
570-        "cellHeight": "sm",
571-        "footer": {
572-          "countRows": false,
573-          "fields": "",
574-          "reducer": [
575-            "sum"
576-          ],
577-          "show": false
578-        },
579-        "showHeader": true
580-      },
581-      "pluginVersion": "10.2.2",
582-      "targets": [
583-        {
584-          "datasource": {
585-            "type": "prometheus",
586-            "uid": "PBFA97CFB590B2093"
587-          },
588-          "editorMode": "code",
589-          "exemplar": false,
590-          "expr": "sish_tunnels_active",
591-          "format": "table",
592-          "instant": true,
593-          "legendFormat": "__auto",
594-          "range": false,
595-          "refId": "A"
596-        }
597-      ],
598-      "title": "Tunnels",
599-      "transformations": [
600-        {
601-          "id": "organize",
602-          "options": {
603-            "excludeByName": {
604-              "Time": true,
605-              "Value": true,
606-              "__name__": true,
607-              "instance": true,
608-              "job": true
609-            },
610-            "indexByName": {
611-              "Time": 0,
612-              "Value": 9,
613-              "__name__": 1,
614-              "connection": 3,
615-              "instance": 5,
616-              "job": 6,
617-              "tunnel": 7,
618-              "type": 4,
619-              "unix": 8,
620-              "user": 2
621-            },
622-            "renameByName": {}
623-          }
624-        }
625-      ],
626-      "type": "table"
627     }
628   ],
629   "refresh": "5s",
630@@ -1003,6 +1003,6 @@
631   "timezone": "",
632   "title": "Tuns",
633   "uid": "a7431274-1d2e-4568-a48c-efc45628c484",
634-  "version": 3,
635+  "version": 4,
636   "weekStart": ""
637 }