Skip to content
Merged

Dev #89

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
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.webjars:stomp-websocket:2.3.4'

// 모니터링
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("io.micrometer:micrometer-registry-prometheus")
}

tasks.named('test') {
Expand Down
8 changes: 8 additions & 0 deletions monitoring/prometheus/config/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global:
scrape_interval: 5s

scrape_configs:
- job_name: "galaxy"
metrics_path: "/actuator/prometheus"
static_configs:
- targets: [ "52.78.187.236:8080" ]
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.logout(AbstractHttpConfigurer::disable)
.sessionManagement(management -> management.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/actuator/prometheus").permitAll()
.requestMatchers("/ws-chat").permitAll()
.requestMatchers("/page/**").permitAll()
.requestMatchers("/api/update-profile").permitAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private boolean checkUri(String requestUri) {
"/",
"/api/sign/**", "/api/token/**", "/api/oauth/**", "/swagger-resources/**", "/swagger-ui/**", "/v3/api-docs/**",
"/img/**", "/css/**", "/static/js/**", "/docs/**",
"/ws-chat", "/page/**"
"/ws-chat", "/page/**", "/actuator/prometheus"
);

for (String pattern : uriPatterns) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ springdoc:
enabled: true
packages-to-scan: com.balybus.galaxy

management:
metrics:
tags:
application:
${spring.application.name}
endpoints:
web:
exposure:
include: prometheus

cors:
allowed:
origins: http://3.37.158.7:8080, http://3.37.158.7:80, http://3.37.158.7:5173, http://3.37.158.7
Loading