Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

AI Observability (Spring AI)

Instruments Spring AI apps with token, latency, cost and prompt-audit telemetry using Micrometer and the GA advisor API.

Dev & CodingAdvanced★ 290⑂ 44AI score 9/10Last updated: Sep 21, 2026

What it does

  • Adds Actuator + Prometheus dependencies and enables Spring AI 1.0+ built-in Micrometer metrics (gen_ai.client.operation, gen_ai.client.token.usage, spring.ai.chat.client).
  • Supplies a custom metrics component that records prompt latency timers and token counters tagged by operation, model and input/output.
  • Provides an audit advisor written against the GA API (CallAdvisor, ChatClientRequest, ChatClientResponse, getCompletionTokens()), avoiding the removed milestone classes.
  • Defines cost-attribution rules: externally managed price tables with effective dates, reject unknown models, keep raw token usage for recalculation.
  • Includes an ai_audit_log JPA entity plus gotchas: @Async must live on a separate bean, keep log-prompt: false in production for PII safety, track failed calls separately.

Who it's for

  • Backend engineers shipping Spring Boot 3 + Spring AI features to production.
  • Teams that need dashboards for LLM token consumption and estimated spend.
  • Anyone tired of AI-generated Spring AI code that uses pre-GA advisor classes and won't compile.

Example uses

  1. "Expose ChatClient P95 latency and token usage to Prometheus" → generates endpoint exposure, histogram config and timer code.
  2. "Write an advisor that logs requestId, tokens and latency for every LLM call" → produces a GA-compliant CallAdvisor implementation.
  3. "Track estimated cost per model" → externalized pricing design plus an audit table storing raw tokens and estimated cost.

· · · 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 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.

  1. Open a terminal and clone the repo: git clone https://github.com/rrezartprebreza/spring-boot-skills.git
  2. Create the skills directory: mkdir -p ~/.claude/skills
  3. Copy just this skill: cp -r spring-boot-skills/skills/spring-boot-3/ai-observability ~/.claude/skills/
  4. Verify that ~/.claude/skills/ai-observability/SKILL.md exists.
  5. Restart Claude Code, then ask something like "add token and latency instrumentation to my ChatClient" inside a Spring AI project.
  6. For general service metrics, health endpoints and OTLP wiring, also copy the production-observability skill from the same repo.