diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index cb1f021..756526a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -132,6 +132,33 @@ services: networks: - aiary + prometheus: + image: prom/prometheus:latest + container_name: prometheus + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + restart: unless-stopped + ports: + - 9090:9090 + networks: + - aiary + + grafana: + image: grafana/grafana:latest + container_name: grafana + volumes: + - ./backend-spring/data/grafana:/var/lib/grafana + - ./prometheus/grafana.ini:/etc/grafana/grafana.ini + restart: unless-stopped + ports: + - 3030:3030 + depends_on: + - prometheus + env_file: + - ./prometheus/grafana.env + networks: + - aiary + networks: aiary: driver: bridge diff --git a/prometheus/grafana.ini b/prometheus/grafana.ini new file mode 100644 index 0000000..cb3fa73 --- /dev/null +++ b/prometheus/grafana.ini @@ -0,0 +1,4 @@ +[server] +domain = grafana +root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/ +serve_from_sub_path = true diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..4402e9e --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,14 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: "prometheus" + static_configs: + - targets: ['prometheus:9090'] + + - job_name: 'backend' + scrape_interval: 5s + metrics_path: '/api/actuator/prometheus' + static_configs: + - targets: ['backend:8080'] \ No newline at end of file