diff --git a/docker-compose.yml b/docker-compose.yml --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,15 @@ depends_on: - zookeeper + prometheus: + image: prom/prometheus + command: + # Needed for the reverse-proxy + - "--web.external-url=/prometheus" + volumes: + - "./prometheus.yml:/etc/prometheus/prometheus.yml:ro" + restart: unless-stopped + nginx: image: nginx volumes: diff --git a/nginx.conf b/nginx.conf --- a/nginx.conf +++ b/nginx.conf @@ -88,6 +88,10 @@ rewrite ^/objstorage/(.*)$ /$1 break; proxy_pass $upstream; } + location /prometheus { + set $upstream "http://prometheus:9090"; + proxy_pass $upstream; + } location / { set $upstream "http://swh-web:5004"; proxy_pass $upstream; diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,12 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +scrape_configs: + - job_name: prometheus + static_configs: + - targets: + - localhost:9090 + metrics_path: /prometheus/metrics