Added Prometheus integration
This commit is contained in:
parent
0123dbe17c
commit
4351f365c9
@ -11,8 +11,13 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(":api")
|
implementation project(":api")
|
||||||
|
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-aop'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
|
|
||||||
|
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package ru.dragonestia.picker.config;
|
||||||
|
|
||||||
|
import io.micrometer.core.aop.TimedAspect;
|
||||||
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MetricsConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
TimedAspect timedAspect(MeterRegistry meterRegistry) {
|
||||||
|
return new TimedAspect(meterRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1 +0,0 @@
|
|||||||
|
|
||||||
10
app/src/main/resources/application.yml
Normal file
10
app/src/main/resources/application.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: health,prometheus
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
metrics:
|
||||||
|
export:
|
||||||
|
enabled: true
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 5s
|
||||||
|
external_labels:
|
||||||
|
monitor: 'codelab-monitor'
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'room-picker_monitoring'
|
||||||
|
scrape_interval: 5s
|
||||||
|
metrics_path: '/actuator/prometheus'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ 'host.docker.internal:8080' ]
|
||||||
Loading…
x
Reference in New Issue
Block a user