Add retention config (#20)

This commit is contained in:
Andrey 2021-10-20 21:16:07 +06:00
parent 4ada20cc13
commit 84acb732b1
3 changed files with 11 additions and 1 deletions

View file

@ -17,7 +17,10 @@ comparison to installing any other Home Assistant add-on.
## Configuration
There are no configuration options for the addon.
### Option: `retention_days`
Specify when to remove old data.
To add additional scrape targets you need to create a file per target in /share/prometheus/targets.

View file

@ -19,5 +19,11 @@
},
"ports_description": {
"9090/tcp": "Not required for Ingress"
},
"schema": {
"retention_days": "int"
},
"options": {
"retention_days": 15
}
}

View file

@ -12,6 +12,7 @@ bashio::log.info 'Starting prometheus...'
options+=(--config.file="/etc/prometheus/prometheus.yml" )
options+=(--storage.tsdb.path="/data/prometheus" )
options+=(--storage.tsdb.retention.time=$(bashio::config 'retention_days')d)
options+=(--web.console.libraries="/usr/share/prometheus/console_libraries" )
options+=(--web.console.templates="/usr/share/prometheus/consoles" )
options+=(--web.route-prefix="/" )