mirror of
https://github.com/hassio-addons/addon-prometheus.git
synced 2025-05-04 11:11:24 +00:00
Add retention config (#20)
This commit is contained in:
parent
4ada20cc13
commit
84acb732b1
3 changed files with 11 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -19,5 +19,11 @@
|
|||
},
|
||||
"ports_description": {
|
||||
"9090/tcp": "Not required for Ingress"
|
||||
},
|
||||
"schema": {
|
||||
"retention_days": "int"
|
||||
},
|
||||
"options": {
|
||||
"retention_days": 15
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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="/" )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue