Monitoring & Logs
Metrics
The service includes:
-
Spring Boot Actuator (
spring-boot-starter-actuator) -
Prometheus registry (
micrometer-registry-prometheusruntime dependency)
Endpoints (under context path):
-
/configs-service/actuator/health -
/configs-service/actuator/metrics -
/configs-service/actuator/prometheus
Logging
The service uses a custom logback-spring.xml configuration (in src/main/resources/).
Console output
All profiles get console output with a custom pattern that includes the MDC requestId field:
2026-03-19T14:30:15.123 INFO 1 --- [http-nio-8080-exec-1] [abc-123-def] c.f.f.angular.tabs.service.TabService : Tabs loaded for device model X
Request correlation
AuditRequestContextFilter reads the X-Request-Id header (generates a UUID when missing) and:
-
Stores it in
AuditRequestContextHolderfor audit records (audit_log.request_id). -
Sets
MDC.put("requestId", …)so every log line within the request includes the ID. -
Cleans up both on request completion.
This allows correlating log lines across a single request and tracing them back to audit records.
requestId is empty for non-HTTP threads (e.g., @Scheduled tasks, async executors).
|