Skip to content

feat(ops): observabilidad con Spring Boot Actuator - #68

Merged
MrDylanDev merged 1 commit into
mainfrom
feat/ops-actuator-observability
Aug 12, 2026
Merged

feat(ops): observabilidad con Spring Boot Actuator#68
MrDylanDev merged 1 commit into
mainfrom
feat/ops-actuator-observability

Conversation

@MrDylanDev

Copy link
Copy Markdown
Owner

Closes #61

PR Type

  • New feature
  • Bug fix
  • Documentation only
  • Code refactoring
  • Maintenance/tooling
  • Breaking change

Summary

  • Agrega spring-boot-starter-actuator para poder diagnosticar incidentes en producción (health, info, metrics).
  • Exposición mínima por perfil: health,info en dev/default; health,info,metrics en prod.
  • Seguridad: /actuator/health público (healthcheck), el resto de /actuator/** requiere rol ADMIN. show-details=never para no filtrar detalles internos.
  • En tests, el health de Actuator ignora el indicador de mail (no hay SMTP; el health global refleja solo la BD).

Changes

File Change
pom.xml Dependencia spring-boot-starter-actuator
src/main/java/com/libromagico/security/SecurityConfig.java /actuator/health permitAll, /actuator/** hasRole ADMIN
src/main/resources/application.properties exposure health,info + show-details=never
src/main/resources/application-prod.properties exposure health,info,metrics
src/main/resources/application-test.properties management.health.mail.enabled=false
src/test/java/com/libromagico/security/SecurityHeadersTest.java 3 tests: health público 200, metrics/info 401 anónimo

Test Plan

  • mvn -B -Pcoverage verify: 177 tests (174 previos + 3 nuevos), 0 fallos
  • Cobertura: 76% instrucciones (gate 70%, sube 1 punto)
  • Healthcheck del compose (usa /api/health custom) sin cambios

Contributor Checklist

- spring-boot-starter-actuator en pom.xml.
- Exposición mínima por perfil: health+info en dev/default; health+info+metrics
  en prod (management.endpoints.web.exposure.include).
- SecurityConfig: /actuator/health público (healthcheck), /actuator/** con rol
  ADMIN; show-details=never.
- Health de Actuator sin indicador de mail en tests (no hay SMTP; el health
  global refleja solo la BD).
- SecurityHeadersTest: /actuator/health público 200, /metrics y /info 401
  anónimo.

Cobertura: 76% instrucciones (gate 70%). 177 tests verdes.
@MrDylanDev
MrDylanDev merged commit a234c23 into main Aug 12, 2026
2 checks passed
@MrDylanDev
MrDylanDev deleted the feat/ops-actuator-observability branch August 12, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant