A metric endpoint is an HTTP endpoint that exposes named application measurements, statistics, and tags. In a Spring Boot application, Actuator provides the endpoint, while Spring AI records token usage, operation counts, and operation timing. section 9.1
Enable and use the endpoint incrementally:
- Add the Actuator starter dependency and expose both health and metrics endpoints. section 9.1
- Start the application and make an application request so that measurements exist. section 9.1
- Append a metric name to /actuator/metrics and issue a GET request with an HTTP client. section 9.1.1
- Inspect measurements for COUNT, TOTAL_TIME, and MAX, then use available tags to filter operations. section 9.1.1
Inspecting AI operations
The gen_ai.client.operation metric can distinguish chat and embedding calls, identify the provider and requested or returned model, and report their counts and timing. Filtering by gen_ai.operation.name:embedding shows embedding-specific statistics. section 9.1.2
Inspecting vector store operations
The db.vector.client.operation metric can reveal add, delete, or query activity, the vector-store system, and whether an error occurred. A tag filter such as db.operation.name:add narrows the response. section 9.1.1
implementation 'org.springframework.boot:spring-boot-starter-actuator'
Use the supplied dependency listing to add Spring Boot Actuator. section 9.1
management.endpoints.web.exposure.include=health,metrics
Use the supplied configuration listing to expose health and metrics endpoints. section 9.1



