cd /news/ai-tools/i-built-a-profiler-to-audit-my-own-a… · home topics ai-tools article
[ARTICLE · art-14792] src=dev.to pub= topic=ai-tools verified=true sentiment=↑ positive

I Built a Profiler to Audit My Own AI Tool Calls. Here's What I Learned About Observability

Ramagiri Tharun built AgentLens, a 47-line Python profiler that parses API logs to audit AI tool call efficiency after loading 157 skills in 12 days revealed zero visibility into usage patterns. The tool uses regex patterns and counters to flag tool use, token consumption, latency, and errors, demonstrating that effective observability does not require complex infrastructure. Tharun emphasizes that AI agent builders should prioritize telemetry over prompts to avoid loops disguised as intelligence.

read1 min publishedMay 27, 2026

I built a profiler to audit my own tool calls.

After 157 skills in 12 days, I realized I had zero visibility into whether I was using them efficiently. So I built AgentLens.

Most AI agent demos look magical because the demo is 30 seconds long. Run the same agent for a day and watch the logs. You will find:

When you give an agent tools but no telemetry, you get loops dressed up as intelligence.

AgentLens parses my API logs and flags patterns every AI builder should be watching. The architecture is embarrassingly simple:

import re, json
from collections import Counter, defaultdict

class AgentLens:
    PATTERNS = {
        "tool_use": [
            r'"name":\s*"([^"]+)"',
            r'"tool_use".*?"name":\s*"([^"]+)"',
        ],
        "tokens": [
            r'"total_tokens":\s*(\d+)',
            r'"completion_tokens":\s*(\d+)',
        ],
        "latency": [
            r'"latency_ms":\s*(\d+)',
            r'(\d+)ms',
        ],
        "errors": [
            r'"error".*?"message":\s*"([^"]+)"',
            r'ERROR[:\s]+(.+)',
        ],
    }

Regex patterns. Counters. A 47-line Python parser. No vector database. No LangChain.

That is the point. Observability does not need to be fancy. It needs to exist.

I do not just install tools. I build them when the gap is real.

If you are building with AI agents, start with observability. The prompts can wait.

Created by Ramagiri Tharun

── more in #ai-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-profiler-t…] indexed:0 read:1min 2026-05-27 ·