Spring Boot Actuator adds production-oriented monitoring and management endpoints to a Spring application. Its metrics endpoint exposes application and Spring AI measurements, including token usage, AI-operation counts, and operation timing. section 9.1
Enable it by adding the Actuator starter and exposing the required endpoints in application.properties. Health remains available while metrics is added explicitly; after the application receives an /ask request, Spring AI collects the measurements automatically. section 9.1
implementation 'org.springframework.boot:spring-boot-starter-actuator'
Add the Spring Boot Actuator starter to the application build. section 9.1
management.endpoints.web.exposure.include=health,metrics
Expose the health and metrics endpoints through application.properties. section 9.1
Generate metrics with an application request
Start the application and call /ask with a game title and question. Processing can involve a vector store, conversation memory, and an AI API, producing metrics for the operations performed. section 9.1
Extend Actuator metrics into a Prometheus-based monitoring workflow:
- Add the Prometheus Micrometer registry and expose the prometheus endpoint. section 9.2
- Run Prometheus, commonly through Docker Compose during development. section 9.2
- Configure Prometheus to scrape /actuator/prometheus every 15 seconds. section 9.2
- Query metrics as tables or graphs and filter them by tags. section 9.2
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'scrapeBoardGameBuddy'
metrics_path: '/actuator/prometheus'
scrape_interval: 15s
static_configs:
- targets: ['host.docker.internal:8080']
Configure Prometheus to scrape the application's Actuator endpoint at a fixed interval. section 9.2
Prometheus supplies time-series storage and querying, while Grafana can turn those metrics into dashboards. Tracing tools such as Jaeger or Zipkin provide a separate view of generative AI activity. section 9.5

