retrying unsuccessful docker start

This commit is contained in:
friendly Friend 2023-05-29 19:13:32 -07:00
parent e56baf4589
commit 890b3c24c6
2 changed files with 76 additions and 124 deletions

View file

@ -1,47 +1,4 @@
{ {
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.4.3"
},
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": { "annotations": {
"list": [ "list": [
{ {
@ -67,14 +24,14 @@
"editable": true, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": 11,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -123,7 +80,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"exemplar": false, "exemplar": false,
@ -140,7 +97,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -190,7 +147,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_stats_user_count", "expr": "immich_server_stats_user_count",
@ -205,7 +162,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -252,7 +209,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "sum(immich_server_stats_usage_by_users)", "expr": "sum(immich_server_stats_usage_by_users)",
@ -267,7 +224,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -314,7 +271,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_info_totalDiskSize", "expr": "immich_server_info_totalDiskSize",
@ -329,7 +286,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -376,7 +333,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_info_diskUse", "expr": "immich_server_info_diskUse",
@ -391,7 +348,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -405,14 +362,6 @@
{ {
"color": "green", "color": "green",
"value": null "value": null
},
{
"color": "red",
"value": 10
},
{
"color": "#EAB839",
"value": 20
} }
] ]
}, },
@ -446,7 +395,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"exemplar": false, "exemplar": false,
@ -465,7 +414,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -513,7 +462,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"exemplar": false, "exemplar": false,
@ -531,7 +480,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -579,10 +528,10 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_usage_growth[7d])", "expr": "increase(immich_server_stats_useage_growth[7d])",
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
"refId": "A" "refId": "A"
@ -595,7 +544,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -647,7 +596,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_stats_usage_by_users", "expr": "immich_server_stats_usage_by_users",
@ -662,7 +611,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -710,7 +659,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_usage_growth[30h])", "expr": "increase(immich_server_stats_usage_growth[30h])",
@ -726,7 +675,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -774,10 +723,10 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_usage_growth[365d])", "expr": "increase(immich_server_stats_useage_growth[365d])",
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
"refId": "A" "refId": "A"
@ -790,7 +739,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -835,7 +784,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_photos_growth[24h])", "expr": "increase(immich_server_stats_photos_growth[24h])",
@ -851,7 +800,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -896,7 +845,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_photos_growth[7d])", "expr": "increase(immich_server_stats_photos_growth[7d])",
@ -912,7 +861,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -964,7 +913,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"exemplar": false, "exemplar": false,
@ -981,7 +930,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1028,7 +977,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_photos_growth[4w])", "expr": "increase(immich_server_stats_photos_growth[4w])",
@ -1044,7 +993,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1091,7 +1040,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_photos_growth[52w])", "expr": "increase(immich_server_stats_photos_growth[52w])",
@ -1107,7 +1056,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"description": "amount of photos over time", "description": "amount of photos over time",
"fieldConfig": { "fieldConfig": {
@ -1118,14 +1067,13 @@
"custom": { "custom": {
"axisCenteredZero": false, "axisCenteredZero": false,
"axisColorMode": "text", "axisColorMode": "text",
"axisGridShow": true,
"axisLabel": "", "axisLabel": "",
"axisPlacement": "right", "axisPlacement": "right",
"axisSoftMin": 9000, "axisSoftMin": 9000,
"barAlignment": 0, "barAlignment": 0,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 30, "fillOpacity": 30,
"gradientMode": "none", "gradientMode": "opacity",
"hideFrom": { "hideFrom": {
"legend": false, "legend": false,
"tooltip": false, "tooltip": false,
@ -1141,10 +1089,10 @@
"type": "linear" "type": "linear"
}, },
"showPoints": "never", "showPoints": "never",
"spanNulls": false, "spanNulls": true,
"stacking": { "stacking": {
"group": "A", "group": "A",
"mode": "normal" "mode": "none"
}, },
"thresholdsStyle": { "thresholdsStyle": {
"mode": "off" "mode": "off"
@ -1187,7 +1135,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_stats_photos_by_users", "expr": "immich_server_stats_photos_by_users",
@ -1203,7 +1151,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1250,7 +1198,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_videos_growth[1d])", "expr": "increase(immich_server_stats_videos_growth[1d])",
@ -1266,7 +1214,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1293,7 +1241,7 @@
"y": 26 "y": 26
}, },
"hideTimeOverride": true, "hideTimeOverride": true,
"id": 44, "id": 40,
"options": { "options": {
"colorMode": "value", "colorMode": "value",
"graphMode": "area", "graphMode": "area",
@ -1313,23 +1261,23 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_videos_growth[4w])\r\n", "expr": "increase(immich_server_stats_videos_growth[1w])",
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
"refId": "A" "refId": "A"
} }
], ],
"timeFrom": "now/M", "timeFrom": "now/w",
"title": "Monthly videos growth", "title": "weekly videos growth",
"type": "stat" "type": "stat"
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1381,7 +1329,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_stats_videos_by_users", "expr": "immich_server_stats_videos_by_users",
@ -1396,7 +1344,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1423,7 +1371,7 @@
"y": 30 "y": 30
}, },
"hideTimeOverride": true, "hideTimeOverride": true,
"id": 40, "id": 44,
"options": { "options": {
"colorMode": "value", "colorMode": "value",
"graphMode": "area", "graphMode": "area",
@ -1443,23 +1391,23 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_videos_growth[1w])", "expr": "increase(immich_server_stats_videos_growth[4w])\r\n",
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
"refId": "A" "refId": "A"
} }
], ],
"timeFrom": "now/w", "timeFrom": "now/M",
"title": "weekly videos growth", "title": "Monthly videos growth",
"type": "stat" "type": "stat"
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -1506,7 +1454,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "increase(immich_server_stats_videos_growth[52w])\r\n", "expr": "increase(immich_server_stats_videos_growth[52w])\r\n",
@ -1522,7 +1470,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"description": "amount of videos over time", "description": "amount of videos over time",
"fieldConfig": { "fieldConfig": {
@ -1538,7 +1486,7 @@
"barAlignment": 0, "barAlignment": 0,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 30, "fillOpacity": 30,
"gradientMode": "none", "gradientMode": "opacity",
"hideFrom": { "hideFrom": {
"legend": false, "legend": false,
"tooltip": false, "tooltip": false,
@ -1554,10 +1502,10 @@
"type": "linear" "type": "linear"
}, },
"showPoints": "never", "showPoints": "never",
"spanNulls": false, "spanNulls": true,
"stacking": { "stacking": {
"group": "A", "group": "A",
"mode": "none" "mode": "normal"
}, },
"thresholdsStyle": { "thresholdsStyle": {
"mode": "off" "mode": "off"
@ -1599,7 +1547,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "o-nLTb0Vz"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "immich_server_stats_videos_by_users", "expr": "immich_server_stats_videos_by_users",
@ -1629,6 +1577,6 @@
"timezone": "", "timezone": "",
"title": "immich", "title": "immich",
"uid": "ZWWp3aa4k", "uid": "ZWWp3aa4k",
"version": 7, "version": 9,
"weekStart": "" "weekStart": ""
} }

View file

@ -215,6 +215,8 @@ class ImmichMetricsCollector:
server_version_endpoint = "/api/server-info/version" server_version_endpoint = "/api/server-info/version"
response_server_version = "" response_server_version = ""
for i in range(0, 360):
while True:
try: try:
response_server_version = requests.request( response_server_version = requests.request(
@ -224,6 +226,8 @@ class ImmichMetricsCollector:
) )
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
logger.error(f"Couldn't get server version: {e}") logger.error(f"Couldn't get server version: {e}")
continue
break
server_version_number = (str(response_server_version.json()["major"]) + "." + server_version_number = (str(response_server_version.json()["major"]) + "." +
str(response_server_version.json()["minor"]) + "." + str(response_server_version.json()["minor"]) + "." +