Allow enabling and disabling prometheus exporter in docker-compose.yml

This commit is contained in:
Eugene Burmakin 2024-11-20 13:56:19 +01:00
parent da19196660
commit 6925e5598b
5 changed files with 20 additions and 3 deletions

View file

@ -9,7 +9,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added ### Added
- Dawarich now exports metrics to Prometheus. You can find the metrics at `/metrics` endpoint. The metrics are being exported in the Prometheus format and can be scraped by Prometheus server. You can find an example of how to scrape the metrics in the `docker-compose.yml` file in the repository. - Dawarich now can export metrics to Prometheus. You can find the metrics at `your.host:9394/metrics` endpoint. The metrics are being exported in the Prometheus format and can be scraped by Prometheus server. To enable exporting, set the `PROMETHEUS_EXPORTER_ENABLED` env var in your docker-compose.yml to `true`. Example:
```yaml
dawarich_app:
image: freikin/dawarich:latest
container_name: dawarich_app
environment:
...
PROMETHEUS_EXPORTER_ENABLED: "true"
```
# 0.16.5 - 2024-11-18 # 0.16.5 - 2024-11-18

View file

@ -1,2 +1 @@
web: bin/rails server -p 3000 -b 0.0.0.0 web: bin/rails server -p 3000 -b 0.0.0.0
prometheus_exporter: bundle exec prometheus_exporter

2
Procfile.prometheus.dev Normal file
View file

@ -0,0 +1,2 @@
web: bin/rails server -p 3000 -b 0.0.0.0
prometheus_exporter: bundle exec prometheus_exporter

View file

@ -6,4 +6,10 @@ then
gem install foreman gem install foreman
fi fi
foreman start -f Procfile.dev if [ "$PROMETHEUS_EXPORTER_ENABLED" = "true" ]; then
echo "Starting Foreman with Procfile.prometheus.dev..."
foreman start -f Procfile.prometheus.dev
else
echo "Starting Foreman with Procfile.dev..."
foreman start -f Procfile.dev
fi

View file

@ -65,6 +65,7 @@ services:
DISTANCE_UNIT: km DISTANCE_UNIT: km
PHOTON_API_HOST: photon.komoot.io PHOTON_API_HOST: photon.komoot.io
PHOTON_API_USE_HTTPS: true PHOTON_API_USE_HTTPS: true
PROMETHEUS_EXPORTER_ENABLED: false
logging: logging:
driver: "json-file" driver: "json-file"
options: options: