-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 스프링 액츄에이터, 프로메테우스 설정 * fix: 테스트 파일 제거
- Loading branch information
1 parent
e9a73cb
commit d6f5654
Showing
13 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
spring: | ||
application: | ||
name: api | ||
profiles: | ||
group: | ||
"local": "db, security, secret, redis, kafka" | ||
"dev": "db, security, secret, redis, kafka" | ||
"local": "db, security, secret, redis, kafka, monitoring" | ||
"dev": "db, security, secret, redis, kafka, monitoring" | ||
default: local | ||
server: | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
global: | ||
scrape_interval: 15s | ||
scrape_timeout: 15s | ||
evaluation_interval: 2m | ||
|
||
external_labels: | ||
monitor: 'system-monitor' | ||
query_log_file: query_log_file.log | ||
|
||
rule_files: | ||
- "rule.yml" | ||
|
||
scrape_configs: | ||
- job_name: "prometheus" | ||
static_configs: | ||
- targets: | ||
- "prometheus:9090" | ||
- job_name: "springboot" | ||
metrics_path: "/actuator/prometheus" | ||
scheme: 'http' | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: | ||
- "host.docker.internal:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
groups: | ||
- name: system-monitor | ||
rules: | ||
- alert: InstanceDown | ||
expr: up == 0 | ||
for: 5m | ||
labels: | ||
severity: page | ||
annotations: | ||
summary: "Instance {{ $labels.instance }} down" | ||
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes." | ||
|
||
- alert: APIHighRequestLatency | ||
expr: api_http_request_latencies_second{quantile="0.5"} > 1 | ||
for: 10m | ||
annotations: | ||
summary: "High request latency on {{ $labels.instance }}" | ||
description: "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// 실행가능한 jar로 생성하는 옵션, main이 없는 라이브러리에서는 false로 비활성화함 | ||
bootJar { enabled = false } | ||
|
||
// 외부에서 의존하기 위한 jar로 생성하는 옵션, main이 없는 라이브러리에서는 true로 비활성화함 | ||
jar { enabled = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 실행가능한 jar로 생성하는 옵션, main이 없는 라이브러리에서는 false로 비활성화함 | ||
bootJar { enabled = false } | ||
|
||
// 외부에서 의존하기 위한 jar로 생성하는 옵션, main이 없는 라이브러리에서는 true로 비활성화함 | ||
jar { enabled = true } | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||
runtimeOnly 'io.micrometer:micrometer-registry-prometheus' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
8 changes: 8 additions & 0 deletions
8
support/monitoring/src/main/resources/application-monitoring.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: prometheus, health, info | ||
metrics: | ||
tags: | ||
application: ${spring.application.name} |