diff --git a/CHANGELOG.md b/CHANGELOG.md index 47a89c8f..8aa52b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### 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 diff --git a/Procfile.dev b/Procfile.dev index 2f1921fb..e6096674 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1 @@ web: bin/rails server -p 3000 -b 0.0.0.0 -prometheus_exporter: bundle exec prometheus_exporter diff --git a/Procfile.prometheus.dev b/Procfile.prometheus.dev new file mode 100644 index 00000000..2f1921fb --- /dev/null +++ b/Procfile.prometheus.dev @@ -0,0 +1,2 @@ +web: bin/rails server -p 3000 -b 0.0.0.0 +prometheus_exporter: bundle exec prometheus_exporter diff --git a/bin/dev b/bin/dev index 948d9bc6..8aa6cf2b 100755 --- a/bin/dev +++ b/bin/dev @@ -6,4 +6,10 @@ then gem install foreman 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 diff --git a/docker-compose.yml b/docker-compose.yml index 7324b3b8..bd3d2049 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,6 +65,7 @@ services: DISTANCE_UNIT: km PHOTON_API_HOST: photon.komoot.io PHOTON_API_USE_HTTPS: true + PROMETHEUS_EXPORTER_ENABLED: false logging: driver: "json-file" options: