prometheus: add customizable storage retention, default to 10 years

This commit is contained in:
uumas
2023-06-26 13:12:09 +03:00
parent 64aa8c574c
commit 901a2f7450
3 changed files with 13 additions and 0 deletions

View File

@@ -2,5 +2,6 @@
prometheus_scrape_interval: 5s prometheus_scrape_interval: 5s
prometheus_evaluation_interval: 15s prometheus_evaluation_interval: 15s
prometheus_storage_retention: 3650d
prometheus_install_grafana: false prometheus_install_grafana: false
prometheus_hcloud_relabel_configs: [] prometheus_hcloud_relabel_configs: []

View File

@@ -14,6 +14,11 @@ argument_specs:
type: str type: str
required: false required: false
default: 15s default: 15s
prometheus_storage_retention:
description: Period of time for which prometheus metrics are stored for. A number followed by unit (s, m, h, d, w, y)
type: str
required: false
default: 3650d
prometheus_hcloud_token: prometheus_hcloud_token:
description: Access token for hetzner cloud service discovery. It will be enabled if this variable is defined description: Access token for hetzner cloud service discovery. It will be enabled if this variable is defined
type: str type: str

View File

@@ -7,6 +7,13 @@
docker_service: prometheus docker_service: prometheus
docker_image: prom/prometheus docker_image: prom/prometheus
reverse_proxy_type: none reverse_proxy_type: none
docker_command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention={{ prometheus_storage_retention }}"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
docker_volumes: docker_volumes:
- name: data - name: data
path: /prometheus path: /prometheus