Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be/#92 jvm 모니터링 #94

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'


implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
Expand All @@ -56,6 +58,9 @@ dependencies {
runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'com.h2database:h2:1.4.200'

runtimeOnly 'io.micrometer:micrometer-registry-prometheus'


annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
developmentOnly 'org.springframework.boot:spring-boot-devtools'

Expand Down
20 changes: 20 additions & 0 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ services:
restart: on-failure
tty: true

prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: on-failure
ports:
- "9090:9090"
networks:
- app-tier
volumes:
- .././prometheus/prometheus.yml:/etc/prometheus/prometheus.yml

grafana:
image: grafana/grafana:latest
container_name: grafana
restart: on-failure
ports:
- "3030:3030"
networks:
- app-tier

networks:
app-tier:
driver: bridge
Expand Down
8 changes: 7 additions & 1 deletion backend/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ logging:
app:
auth:
token:
auth-header: Authorization
auth-header: Authorization

management:
endpoints:
web:
exposure:
include: prometheus
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/v1/actuator/prometheus'
static_configs:
- targets: ['backend:8080']