A chat endpoint that worked yesterday can cost three times as much today, or take ten seconds instead of two, and nothing in your logs will say so. The model's reply was fine. The bill and the latency are not in the reply; they are in numbers you have to decide to collect: how many tokens went in, how many came out, how long each model call took, which endpoint caused them, and whether a retry quietly happened underneath.
Spring AI 2.0 records a good deal of this for you through Micrometer, and publishes traces through OpenTelemetry. This article shows what it records, what it deliberately does not, and how to close the gap: tokens and cost per endpoint, a Grafana dashboard that charts them, and the traps that make a dashboard lie. The depth is in expandable sections, so you can read straight through or open only what you need.
Versions, and an honest limit. Spring Boot 4.1.1, Spring AI 2.0.1, Micrometer 1.17.1, OpenTelemetry 1.62.0, Prometheus 3.15.0, Grafana 13.2.3 and Java 25. All the code is in the observability module of asmhatre/spring-ai, and every console block below is quoted from a file under its output/ directory. No real AI provider was called. The application uses the real OpenAiChatModel and the real OpenAI Java SDK, but pointed at a small local server I wrote that speaks the same HTTP protocol. So every meter name, tag, span and retry below is what Spring AI really produces. The token counts are only about characters divided by four, the latencies are the fake server's, and the prices in the configuration are made-up examples, not anyone's price list. This article is evidence about the instrumentation. It is not evidence about what any provider's calls cost or how long they take.