Skip to content

Commit 2ec2cb3

Browse files
Added micrometer to enable default metrics
1 parent 6a1a8ef commit 2ec2cb3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ repositories {
2121
dependencies {
2222
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
2323
implementation 'org.springframework.boot:spring-boot-starter-webflux'
24+
implementation 'org.springframework.boot:spring-boot-starter-actuator'
25+
implementation 'io.micrometer:micrometer-registry-prometheus:latest.release'
2426
compileOnly 'org.projectlombok:lombok'
2527
annotationProcessor 'org.projectlombok:lombok'
2628
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
server.port=4000
2-
spring.data.mongodb.uri=mongodb://giri:spring2020@db:27017/api?authSource=api&&authMechanism=SCRAM-SHA-1
2+
# For GCP:
3+
#spring.data.mongodb.uri=mongodb://giri:spring2020@db:27017/api?authSource=api
4+
# For docker-compose use the below:
5+
spring.data.mongodb.uri=mongodb://giri:spring2020@db:27017/api?authSource=test
6+
management.endpoints.web.exposure.include=health,metrics,prometheus
7+
management.endpoint.health.show-details=always

0 commit comments

Comments
 (0)