Skip to content
launchdarkly avatar

Built In Metrics

Instrument existing provider calls so LaunchDarkly records duration, tokens, success/error, and tool-call metrics automatically.

CCM score
70 of 100
skills.sh installs
1.9K
GitHub stars
32
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Walks a four-tier ladder from convenience functions to config() with handler packages, custom handlers, and manual track() calls
  • Covers OpenAI, Anthropic, LangChain, Bedrock, Gemini, Strands, and custom HTTP providers, with streaming via stream()
  • Enforces a rule against adding manual tracking on top of invoke(), since the SDK already records those metrics and duplicates would double count
  • Designed for Python (launchdarkly-ai-server) and Node.js (@launchdarkly/ai-node) projects that already have a LaunchDarkly AI config

Install

$ npx -y skills add launchdarkly/ai-tooling --skill built-in-metrics -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Agent Metrics Instrumentation

You're using a skill that gets LaunchDarkly agent metrics flowing from an existing provider call. Your job is to audit what's already there, pick the right tier from the ladder below, and implement it with the least ceremony that still captures the metrics the Monitoring tab needs.

The single most important thing to get right: in the current SDKs, metrics are a side effect of routing the call through the SDK. There is no tracker to create and no wrapper to call. If the provider call runs inside config().invoke() (or a convenience function), the SDK records the metrics. If it runs outside, nothing is recorded.

What the SDK records

Every invoke() and stream() call records these events against the served variation:

EventMetric
$ld:ai:duration:totalDuration, in milliseconds
$ld:ai:generation:success / $ld:ai:generation:errorGeneration counts and error rate
$ld:ai:tokens:input, :output, :totalToken usage, from the handler's normalized usage
$ld:ai:tool_callOne event per tool call the SDK dispatches

Details

Repository
github.com/launchdarkly/ai-tooling
Category
AI Agents & LLM Apps
First seen
Jul 14, 2026

Questions

What does the built-in-metrics skill do?

It instruments an existing codebase so LaunchDarkly records agent config metrics such as duration, tokens, success and error counts, and tool calls. It walks a four-tier ladder and picks the lowest-ceremony option that still captures what the Monitoring tab needs.

How do I install the built-in-metrics skill?

Run npx -y skills add launchdarkly/ai-tooling --skill built-in-metrics -y in your project. Once installed, the agent can route your provider calls through the SDK so metrics are recorded automatically.

Which metrics does the skill get flowing to LaunchDarkly?

It covers the duration total, generation success and error counts, input, output and total token usage, and one tool call event per dispatched tool. Time to first token and user feedback are not recorded by the current SDKs, so manual tracking is needed for feedback.

Where does built-in-metrics stand in the AI Agents & LLM Apps category?

It is listed in the AI Agents & LLM Apps category on Claude Marketplaces, alongside skills such as microsoft-foundry, azure-ai and the google-agents-cli skills. Its focus is on adding metrics to an existing provider call rather than building agents from scratch.

More from launchdarkly/ai-tooling

All 40

Similar to Built In Metrics

More AI Agents & LLM Apps