Skip to content

Commit 51a257c

Browse files
authored
merge(monitoring) : 모니터링 환경 구축 및 과부화 테스트
[Merge] : 모니터링 환경 구축 및 과부화 테스트
2 parents d3376c2 + f5bbcdf commit 51a257c

File tree

5 files changed

+53
-39
lines changed

5 files changed

+53
-39
lines changed

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies {
2727
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2828
implementation 'org.springframework.boot:spring-boot-starter-security'
2929
implementation 'org.springframework.boot:spring-boot-starter-aop'
30-
implementation 'org.springframework.boot:spring-boot-starter-actuator'
3130
implementation 'org.springframework.boot:spring-boot-starter-batch'
3231
implementation 'org.springframework.boot:spring-boot-starter-webflux'
3332

@@ -59,6 +58,10 @@ dependencies {
5958
testImplementation 'org.springframework.boot:spring-boot-starter-test'
6059
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
6160
testImplementation 'com.h2database:h2'
61+
62+
// Monitoring
63+
implementation 'org.springframework.boot:spring-boot-starter-actuator'
64+
implementation 'io.micrometer:micrometer-registry-prometheus'
6265
}
6366

6467
// QueryDSL Settings

src/main/java/org/terning/terningserver/common/config/SecurityConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public class SecurityConfig {
3232
"/api/v1/users/**",
3333
"/api/v1/push-status",
3434
"/api/v1/external/scraps/unsynced",
35-
"/api/v1/external/scraps/sync/result"
35+
"/api/v1/external/scraps/sync/result",
36+
"/actuator/**",
3637
};
3738

3839
@Bean

src/main/java/org/terning/terningserver/external/pushNotification/user/domain/UserSyncEvent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.terning.terningserver.external.pushNotification.user.domain;
22

33
import jakarta.persistence.Entity;
4+
import jakarta.persistence.EnumType;
45
import jakarta.persistence.Enumerated;
56
import jakarta.persistence.GeneratedValue;
67
import jakarta.persistence.GenerationType;
@@ -24,7 +25,7 @@ public class UserSyncEvent {
2425

2526
private Long userId;
2627

27-
@Enumerated
28+
@Enumerated(EnumType.STRING)
2829
private UserSyncEventType eventType;
2930

3031
private String newValue;
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
spring:
2-
datasource:
3-
url: jdbc:h2:mem:testdb;MODE=PostgreSQL;DATABASE_TO_UPPER=FALSE
4-
username: sa
5-
password:
6-
# driver-class-name: org.h2.Driver
7-
8-
jpa:
9-
hibernate:
10-
ddl-auto: create-drop
11-
properties:
12-
hibernate:
13-
dialect: org.hibernate.dialect.H2Dialect
14-
format_sql: true
15-
show-sql: true
16-
17-
h2:
18-
console:
19-
enabled: true
20-
path: /h2-console
21-
22-
batch:
23-
job:
24-
enabled: false
25-
26-
jwt:
27-
secret-key: "this-is-a-temporary-secret-key-for-local-tests-1234567890"
28-
access-token-expired: 3600000
29-
refresh-token-expired: 86400000
30-
31-
operation:
32-
base-url: http://localhost:9999
33-
34-
discord:
35-
webhook:
36-
url: "https://discord.com/api/webhooks/test/test"
1+
#spring:
2+
# datasource:
3+
# url: jdbc:h2:mem:testdb;MODE=PostgreSQL;DATABASE_TO_UPPER=FALSE
4+
# username: sa
5+
# password:
6+
## driver-class-name: org.h2.Driver
7+
#
8+
# jpa:
9+
# hibernate:
10+
# ddl-auto: create-drop
11+
# properties:
12+
# hibernate:
13+
# dialect: org.hibernate.dialect.H2Dialect
14+
# format_sql: true
15+
# show-sql: true
16+
#
17+
# h2:
18+
# console:
19+
# enabled: true
20+
# path: /h2-console
21+
#
22+
# batch:
23+
# job:
24+
# enabled: false
25+
#
26+
#jwt:
27+
# secret-key: "this-is-a-temporary-secret-key-for-local-tests-1234567890"
28+
# access-token-expired: 3600000
29+
# refresh-token-expired: 86400000
30+
#
31+
#operation:
32+
# base-url: http://localhost:9999
33+
#
34+
#discord:
35+
# webhook:
36+
# url: "https://discord.com/api/webhooks/test/test"

src/main/resources/application.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,12 @@ discord:
5353

5454
firebase:
5555
service-key: ${FIREBASE_SERVICE_KEY_JSON}
56+
57+
management:
58+
endpoints:
59+
web:
60+
exposure:
61+
include: prometheus
62+
endpoint:
63+
prometheus:
64+
enabled: true

0 commit comments

Comments
 (0)