Prometheus is an open-source monitoring and alerting toolkit that collects application metrics through Micrometer, stores them as time series, and supports querying and visualization. In a Spring Boot application, it consumes metrics exposed by Actuator, including Spring AI operations. section 9.2 section 9.5
A typical Spring Boot integration proceeds as follows:
- Add the Prometheus Micrometer registry dependency and expose the Actuator prometheus endpoint. section 9.2
- Run a Prometheus instance, commonly with Docker Compose during development. section 9.2
- Configure a scrape job for /actuator/prometheus, using a 15-second scrape interval in the example application. section 9.2
- Query metrics by name or tag, then use Grafana to assemble interactive dashboards from the Prometheus data. section 9.1.4 section 9.3
Monitoring Spring AI chat operations
The spring.ai.chat.client metric reports counts and timing measurements for ChatClient operations. Its tags distinguish streaming interactions, errors, and the Spring AI component; Prometheus can display these values as tables or time-series graphs. section 9.1.4 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']
Use the scrape configuration to connect Prometheus to the application's Actuator endpoint and collect metrics at regular intervals. section 9.2







