Selaa lähdekoodia

Add RETENTION_TIME option to RPi Monitor Stack (#228)

Rafael Blumberg 3 vuotta sitten
vanhempi
commit
7722837cfe

BIN
docs/images/rpi_docker_monitor-DeployStack.png


+ 4 - 0
docs/rpi_docker_monitor.md

@@ -107,6 +107,10 @@ Done You are ready to goto next step in the install document
 
 
 Goto App Templates and install "Raspberry Pi Docker Monitor"
 Goto App Templates and install "Raspberry Pi Docker Monitor"
 
 
+You can change how long your data should be stored or leave the default **15d**. It can be set with {`ms`,`s`,`m`,`h`,`d`,`w`,`y`} or a combination of it (e.g. `2w3d` for 2 weeks and 3 days).
+
+![Stack Settings](https://raw.githubusercontent.com/novaspirit/pi-hosted/master/docs/images/rpi_docker_monitor-DeployStack.png)
+
 The default settings should all be good so **Deploy the Stack**
 The default settings should all be good so **Deploy the Stack**
 <br><br>
 <br><br>
 
 

+ 7 - 0
pi-hosted_template/template/portainer-v2.json

@@ -3869,6 +3869,13 @@
 			"ports": [
 			"ports": [
 				"3000:3000/tcp"
 				"3000:3000/tcp"
 			],
 			],
+			"env": [
+				{
+					"default": "15d",
+					"label": "PROMETHEUS_RETENTION",
+					"name": "PROMETHEUS_RETENTION"
+				}
+			],
 			"restart_policy": "unless-stopped",
 			"restart_policy": "unless-stopped",
 			"title": "Raspberry Pi Docker Monitor",
 			"title": "Raspberry Pi Docker Monitor",
 			"type": 3,
 			"type": 3,

+ 1 - 0
stack/raspberrypi-monitoring.yml

@@ -58,6 +58,7 @@ services:
     command:
     command:
       - '--config.file=/etc/prometheus/prometheus.yml'
       - '--config.file=/etc/prometheus/prometheus.yml'
       - '--storage.tsdb.path=/prometheus'
       - '--storage.tsdb.path=/prometheus'
+      - '--storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-15d}'
     container_name: monitoring-prometheus
     container_name: monitoring-prometheus
     expose:
     expose:
       - 9090
       - 9090

+ 7 - 0
template/portainer-v2-arm32.json

@@ -3869,6 +3869,13 @@
 			"ports": [
 			"ports": [
 				"3000:3000/tcp"
 				"3000:3000/tcp"
 			],
 			],
+			"env": [
+				{
+					"default": "15d",
+					"label": "PROMETHEUS_RETENTION",
+					"name": "PROMETHEUS_RETENTION"
+				}
+			],
 			"restart_policy": "unless-stopped",
 			"restart_policy": "unless-stopped",
 			"title": "Raspberry Pi Docker Monitor",
 			"title": "Raspberry Pi Docker Monitor",
 			"type": 3,
 			"type": 3,

+ 7 - 0
template/portainer-v2-arm64.json

@@ -4036,6 +4036,13 @@
 			"ports": [
 			"ports": [
 				"3000:3000/tcp"
 				"3000:3000/tcp"
 			],
 			],
+			"env": [
+				{
+					"default": "15d",
+					"label": "PROMETHEUS_RETENTION",
+					"name": "PROMETHEUS_RETENTION"
+				}
+			],
 			"restart_policy": "unless-stopped",
 			"restart_policy": "unless-stopped",
 			"title": "Raspberry Pi Docker Monitor",
 			"title": "Raspberry Pi Docker Monitor",
 			"type": 3,
 			"type": 3,