liveBook · Manning

Spring Boot Actuator

As explained in Spring AI in Action

Spring Boot Actuator is a Spring Boot module that provides production-oriented monitoring and management endpoints for an application.

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

How Spring AI in Action covers it

How deep it goes
Explains dependency and endpoint configuration, automatic collection, and Prometheus integration, stopping short of Actuator internals.
Examples
Uses an /ask request, Actuator endpoints, Prometheus scraping, metric graphs, tables, and tag filtering.
What it assumes
Assumes a running Spring application and familiarity with build dependencies, application.properties, and basic HTTP requests.
What you can do after
Operate/configure an application to expose Spring AI metrics and connect them to Prometheus for querying and dashboards.
How it connects
Connects Spring AI, Micrometer, Prometheus, Grafana, vector stores, and tracing tools such as Jaeger and Zipkin.

Also explained in

Compare how 2 books explain Spring Boot Actuator →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.