Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit b6dde25

Browse files
Add Prometheus support and expose actuator
Add Micrometer Prometheus registry to Gradle dependencies and enable Prometheus metrics export. Expose the prometheus actuator endpoint via management.endpoints.web.exposure.include and allow all /actuator/** requests in SecurityConfig so metrics can be scraped. Also add a MONITORING.md placeholder.
1 parent 318ef05 commit b6dde25

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

MONITORING.md

Whitespace-only changes.

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ dependencies {
8484
implementation 'at.favre.lib:bcrypt:0.10.2'
8585
implementation 'uk.co.conoregan:themoviedbapi:2.1.1'
8686
implementation 'org.springframework.boot:spring-boot-starter-actuator'
87+
implementation 'io.micrometer:micrometer-registry-prometheus'
8788
implementation 'org.springframework.boot:spring-boot-starter-graphql'
8889
implementation 'org.springframework.boot:spring-boot-starter-web'
8990
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

src/main/java/com/espacogeek/geek/config/SecurityConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception {
5353
.cors(withDefaults())
5454
.csrf(csrf -> csrf.disable())
5555
.authorizeHttpRequests(auth -> {
56-
auth.requestMatchers("/", "/graphiql", "/graphiql/**", "/favicon.ico", "/actuator/health").permitAll();
56+
auth.requestMatchers("/", "/graphiql", "/graphiql/**", "/favicon.ico").permitAll();
57+
auth.requestMatchers("/actuator/**").permitAll();
5758
auth.requestMatchers(org.springframework.http.HttpMethod.OPTIONS, "/**").permitAll();
5859
auth.anyRequest().authenticated();
5960
})

src/main/resources/application.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ spring.mail.properties.mail.smtp.timeout=5000
4848
spring.mail.properties.mail.smtp.writetimeout=5000
4949

5050
# ===== Actuator / Management Endpoints =====
51-
management.endpoints.web.exposure.include=health,info
51+
management.endpoints.web.exposure.include=health,info,prometheus
5252
management.endpoint.health.show-details=always
53+
management.metrics.export.prometheus.enabled=true
5354

5455
# Application settings
5556
app.name=${APP_NAME:EspacoGeek}

0 commit comments

Comments
 (0)