Skip to content

Commit 55729e5

Browse files
authored
Merge pull request #87 from Apptive-Game-Team/feature/86
feat: expose Prometheus metrics on a separate management port
2 parents 134710b + 538b49b commit 55729e5

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ dependencies {
6060
implementation 'org.springframework.boot:spring-boot-starter-security'
6161
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
6262

63+
// Metrics
64+
implementation 'org.springframework.boot:spring-boot-starter-actuator'
65+
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
66+
6367
testImplementation 'org.springframework.security:spring-security-test'
6468
}
6569

src/main/resources/application.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
server:
22
port: ${PORT}
33

4+
# Metrics run on their own port so the public app port never serves /actuator.
5+
# The app SecurityFilterChain does not guard the management context, so
6+
# MANAGEMENT_PORT must stay reachable only from the Prometheus host.
7+
management:
8+
server:
9+
port: ${MANAGEMENT_PORT:8081}
10+
endpoints:
11+
web:
12+
exposure:
13+
include: health,prometheus
14+
metrics:
15+
tags:
16+
application: ${spring.application.name}
17+
418
spring:
519
application:
620
name: word-online-matching

0 commit comments

Comments
 (0)