The spring.ai.chat.client metric records aggregate counts and durations for operations flowing through Spring AI’s ChatClient. Its measurements accumulate since application startup, while spring.ai.chat.client.active reports operations currently in progress. section 9.1.4 section 9.1
Use the metric to:
- Count ChatClient operations and inspect their total duration. section 9.1.4
- Separate streaming from nonstreaming requests with the spring.ai.chat.client.stream tag. section 9.1.4
- Query the metric through the Actuator metrics endpoint after exposing the metrics endpoint. section 9.1
Filtering streaming operations
An endpoint response showing 23 operations can be filtered by spring.ai.chat.client.stream:true to identify 11 streaming operations; the remaining 12 are nonstreaming.
