Skip to content

Commit 892cbef

Browse files
committed
docs: 프로메테우스 설정 추가
1 parent aee05e0 commit 892cbef

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: ["main", "develop"]
66
types: [opened, reopened, ready_for_review, synchronize]
7+
push:
8+
branches:
9+
- 옥정현/feat-181
710

811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}

backend/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ dependencies {
9090

9191
// Redisson (redis를 통한 분산락)
9292
implementation("org.redisson:redisson-spring-boot-starter:3.46.0")
93+
94+
// prometheus (모니터링툴)
95+
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
96+
9397
}
9498

9599

backend/k6/prod/prometheus.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
global:
2+
scrape_interval: 15s
3+
evaluation_interval: 15s
4+
5+
scrape_configs:
6+
- job_name: 'unihub-springboot-https'
7+
metrics_path: '/actuator/prometheus'
8+
scheme: https
9+
tls_config:
10+
insecure_skip_verify: true # 자체 서명(Self-Signed) 인증서 등이면 true로 두거나 CA를 신뢰하도록 설정
11+
static_configs:
12+
- targets:
13+
- 'api.un1hub.site:443'
14+
labels:
15+
env: production
16+

backend/src/main/resources/application.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ management:
5050
health:
5151
mail:
5252
enabled: false
53+
endpoints:
54+
web:
55+
exposure:
56+
include: health,info,prometheus # prometheus 엔드포인트 노출
57+
metrics:
58+
tags:
59+
application: ${spring.application.name} # 기본 태그로 application 이름 추가
60+
prometheus:
61+
metrics:
62+
export:
63+
enabled: true
5364

5465
logging:
5566
web:
@@ -95,4 +106,6 @@ cors:
95106

96107
sentry:
97108
dsn: ${custom.sentry.dsn}
98-
send-default-pii: ${custom.sentry.send-default-pii}
109+
send-default-pii: ${custom.sentry.send-default-pii}
110+
111+

0 commit comments

Comments
 (0)