Skip to content

Commit

Permalink
Merge pull request #333 from Team-Smeme/chore/#monitoring
Browse files Browse the repository at this point in the history
feat: 모니터링 시스템 구축 (-ing)
  • Loading branch information
thguss authored Oct 13, 2024
2 parents cb40557 + ac02818 commit 1818e80
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docker/monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'

services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- --config.file=/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- monitoring-network

grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
networks:
- monitoring-network

networks:
monitoring-network:
driver: bridge
8 changes: 8 additions & 0 deletions docker/monitoring/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global:
scrape_interval: 15s

scrape_configs:
- job_name: prometheus
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8080']
1 change: 1 addition & 0 deletions smeem-bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
}

tasks.bootJar {
Expand Down
5 changes: 5 additions & 0 deletions smeem-bootstrap/src/main/resources/application-actuator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
management:
endpoints:
web:
exposure:
include: info, health, metrics, prometheus
1 change: 1 addition & 0 deletions smeem-bootstrap/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
spring:
config:
import:
- classpath:application-actuator.yml
- classpath:oauth-apple-config/application.yml
- classpath:oauth-kakao-config/application.yml
application:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private void setHttp(HttpSecurity http) throws Exception {
.requestMatchers(new AntPathRequestMatcher("/api/v2/plans")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/favicon.ico")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/error")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/actuator/**")).permitAll()
.anyRequest().authenticated())
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
Expand Down

0 comments on commit 1818e80

Please sign in to comment.