diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /idvoc-2025/metrics | |
Diffstat (limited to 'idvoc-2025/metrics')
| -rw-r--r-- | idvoc-2025/metrics/README.md | 6 | ||||
| -rw-r--r-- | idvoc-2025/metrics/docker-compose.yml | 25 | ||||
| -rw-r--r-- | idvoc-2025/metrics/prometheus.yml | 16 | ||||
| -rwxr-xr-x | idvoc-2025/metrics/start.sh | 10 |
4 files changed, 57 insertions, 0 deletions
diff --git a/idvoc-2025/metrics/README.md b/idvoc-2025/metrics/README.md new file mode 100644 index 0000000..02b4566 --- /dev/null +++ b/idvoc-2025/metrics/README.md @@ -0,0 +1,6 @@ +# Metrics + +Use ./start.sh to start this small metrics stack. You can do it manually if +needed, peek a look at start.sh. + +You'll have to edit prometheus.yml and docker-compose.yml to fix the project diff --git a/idvoc-2025/metrics/docker-compose.yml b/idvoc-2025/metrics/docker-compose.yml new file mode 100644 index 0000000..4a7af07 --- /dev/null +++ b/idvoc-2025/metrics/docker-compose.yml @@ -0,0 +1,25 @@ +--- + +version: "3" + +services: + prometheus: + image: prom/prometheus:v2.45.2 + container_name: prometheus + # FIXME Provide prometheus.yml + volumes: + - /tmp/prometheus.yml:/data + # FIXME Expose prometheus locally + ports: 9090 + # FIXME Make prometheus able to reach CommentsEngine and CommentsInteractor + + grafana: + image: grafana/grafana:10.2.3 + container_name: grafana + ports: + - 127.0.0.1:3000:3000 + volumes: + - grafana-storage:/var/lib/grafana + +volumes: + grafana-storage: {} diff --git a/idvoc-2025/metrics/prometheus.yml b/idvoc-2025/metrics/prometheus.yml new file mode 100644 index 0000000..27def20 --- /dev/null +++ b/idvoc-2025/metrics/prometheus.yml @@ -0,0 +1,16 @@ +global: + scrape_interval: 5s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. + - job_name: "prometheus" + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ["localhost:9090"] + + # FIXME Expand scrape_configs here diff --git a/idvoc-2025/metrics/start.sh b/idvoc-2025/metrics/start.sh new file mode 100755 index 0000000..e1bab25 --- /dev/null +++ b/idvoc-2025/metrics/start.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -eExuo pipefail + +# This basic script is needed to cope with the PIE's limitation regarding +# docker and each student's home directory. One cannot mount with docker +# files from home directory. + +cp prometheus.yml /tmp/prometheus.yml +docker compose up -d || docker-compose up -d |
