#35 springboot: prometheus
This commit is contained in:
@@ -23,6 +23,7 @@ dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator' //actuator 추가
|
||||
implementation 'io.micrometer:micrometer-registry-prometheus'
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
runtimeOnly 'com.h2database:h2'
|
||||
|
||||
21
springboot/actuator/prometheus.yml
Normal file
21
springboot/actuator/prometheus.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# docker run -p 9090:9090 -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
|
||||
rule_files:
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:9090']
|
||||
|
||||
- job_name: 'actuator'
|
||||
metrics_path: '/actuator/prometheus'
|
||||
scrape_interval: 1s
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:8080']
|
||||
@@ -1,6 +1,6 @@
|
||||
management:
|
||||
server:
|
||||
port: 9292
|
||||
port: 8080
|
||||
info:
|
||||
java:
|
||||
enabled: true
|
||||
@@ -29,3 +29,8 @@ logging:
|
||||
level:
|
||||
hello.controller: debug
|
||||
|
||||
server:
|
||||
tomcat:
|
||||
mbeanregistry:
|
||||
enabled: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user