Skip to content

Commit

Permalink
chore: grafana, prometheus 도커 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Nov 21, 2023
1 parent b8b007e commit 1ccea1d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions prometheus/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[server]
domain = grafana
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
serve_from_sub_path = true
14 changes: 14 additions & 0 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -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']

0 comments on commit 1ccea1d

Please sign in to comment.