AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

AI Observability (Spring AI)

Adds token usage, latency, cost attribution, and prompt audit telemetry to Spring AI apps using the correct 1.0 GA APIs.

Dev & CodingAdvanced★ 367⑂ 57AI score 9/10Last updated: Nov 17, 2026

What it does

  • Configures application.yml to expose Spring AI 1.0+ built-in Micrometer instrumentation (gen_ai.client.operation, gen_ai.client.token.usage, spring.ai.chat.client).
  • Implements custom latency timers and token counters on MeterRegistry, tagged by model and operation.
  • Ships an audit advisor written against the post-GA API (CallAroundAdvisor→CallAdvisor, AdvisedRequest→ChatClientRequest, getGenerationTokens()→getCompletionTokens()).
  • Keeps prompt/completion logging off by default for PII safety and pushes model pricing into externally managed config with effective dates.
  • Persists audit rows via a separate @Async bean, with guidance on bounded executors and rejected-task monitoring.

Who it's for

  • Backend engineers shipping LLM features on Spring Boot 3 + Spring AI.
  • Platform/SRE teams that need dashboards for token spend and model latency.
  • Teams in regulated environments that must audit AI calls.

Examples

  1. "Export P95 latency and token usage for my ChatClient to Prometheus" → actuator/Micrometer config plus percentile histograms.
  2. "Build an audit advisor for AI calls" → a GA-correct CallAdvisor logging requestId, tokens, and latency.
  3. "Aggregate estimated cost per model" → externalized pricing table that rejects unknown models instead of defaulting.

· · · 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on AI 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 /tmp/spring-boot-skills && mkdir -p ~/.claude/skills && cp -r /tmp/spring-boot-skills/skills/spring-boot-3/ai-observability ~/.claude/skills/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Open a terminal.
  2. Clone the repo: git clone https://github.com/rrezartprebreza/spring-boot-skills.git
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r spring-boot-skills/skills/spring-boot-3/ai-observability ~/.claude/skills/
  5. Verify with ls ~/.claude/skills/ai-observability — you should see SKILL.md and a templates/ folder.
  6. Restart Claude Code and try a prompt like "add token usage metrics to my Spring AI service".