Spring AI Observability
Adds token, cost, latency, and audit-log instrumentation to Spring AI / LLM calls in Spring Boot.
Dev & CodingIntermediate★ 210⑂ 35AI score 9/10Last updated: Aug 10, 2026
What it does
- Configures Spring AI 1.0 GA's built-in Micrometer instrumentation (
gen_ai.client.token.usage,gen_ai.client.operation) plus Actuator/Prometheus exposure. - Supplies
MeterRegistrycode for custom metrics: prompt latency timers and input/output token counters. - Provides a
CallAdvisoraudit advisor for prompt/response logging, a per-model cost estimator, and an asyncai_audit_logpersistence pattern. - Flags the GA API renames (
CallAroundAdvisor→CallAdvisor,AdvisedRequest→ChatClientRequest,getGenerationTokens()→getCompletionTokens()) that commonly break generated code.
Who it's for
- Backend engineers shipping LLM features on Spring Boot 3 + Spring AI.
- Teams that need token usage and monthly LLM spend on a dashboard.
- Organizations already running Prometheus/Grafana monitoring.
Examples
- "Export ChatClient P95 latency and token usage to Prometheus" → generates Actuator/histogram config and custom Timer/Counter beans.
- "Audit-log prompt length and token counts per request" → implements
AiAuditAdvisorwith async DB persistence. - "Build a per-model cost estimator" → produces
AiCostEstimatorfrom a per-1M-token pricing map, with advice to externalize prices to config.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/rrezartprebreza/spring-boot-skills/HEAD/skills/spring-boot-3/ai-observability/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/spring-boot-3/ai-observability folder from the GitHub repo rrezartprebreza/spring-boot-skills into my ~/.claude/skills/ai-observability/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/rrezartprebreza/spring-boot-skills.git && mkdir -p ~/.claude/skills && cp -r spring-boot-skills/skills/spring-boot-3/ai-observability ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and cd into any working directory.
- Clone the repo:
git clone https://github.com/rrezartprebreza/spring-boot-skills.git - Create the skills directory if needed:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r spring-boot-skills/skills/spring-boot-3/ai-observability ~/.claude/skills/ - Run
claudeinside your project and ask something like "add token cost monitoring to my Spring AI service" to trigger the skill. - Make sure your build includes
spring-boot-starter-actuatorandmicrometer-registry-prometheus, and keeplog-prompt: falsein production.
View source on GitHub ↗License: MIT