launchdarkly avatar

Built In Metrics

This walks you through the four-tier ladder LaunchDarkly recommends for instrumenting AI provider calls with metrics tracking: managed runner, provider package with trackMetricsOf, custom extractor, or raw manual calls. The core insight is to default to the highest tier that fits your call shape, because going straight to manual tracker calls costs you drift and missed metrics. It audits your existing code to determine whether you have a chat loop, one-shot completion, or agent step, checks which provider package exists for your framework and language, then points you to reference implementations. Includes a migration path if you're still on the pre-0.20 SDK surface with aiclient.config instead of completion_config.

skills.sh installs
1.3K
GitHub stars
19
last updated
Jul 14, 2026

Install

$ npx -y skills add launchdarkly/agent-skills --skill built-in-metrics --agent claude-code

Installs into .claude/skills of the current project.

Files

Agent Metrics Instrumentation

You're using a skill that wires LaunchDarkly agent metrics around 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 (duration, input/output tokens, success/error, plus TTFT when streaming).

The single most important thing to get right: default to the highest tier that fits the shape of the call. Going lower ("just write the manual tracker calls") looks flexible but costs you drift, missed metrics, and legacy patterns the SDKs have moved past.

The four-tier ladder

This is the order the official SDK READMEs (Python core, Node core, and every provider package) recommend. Walk from the top and stop at the first tier that fits:

Sponsors

Details

Repository
github.com/launchdarkly/agent-skills
Category
AI & Agent Building
First seen
Jul 14, 2026

More from launchdarkly/agent-skills

All 41
1launchdarkly avatarconfigs-updatelaunchdarkly/agent-skillsconfigs update1.3Kskills.sh installs
2launchdarkly avatarsnippetslaunchdarkly/agent-skillssnippets1.3Kskills.sh installs
3tech-leads-club avatartlc-spec-driventech-leads-club/agent-skillsFeature planning and implementation with 4 adaptive phases (Specify, Design, Tasks, Execute). Auto-sizes depth by complexity. Writes testable requirements in EA1.3Kskills.sh installs
4hyva-themes avatarhyva-theme-listhyva-themes/hyva-ai-toolsList all Hyvä theme paths in a Magento 2 project. This skill should be used when the user wants to find Hyvä themes, list available themes, discover theme paths1.3Kskills.sh installs
5hyva-themes avatarhyva-create-modulehyva-themes/hyva-ai-toolsCreate a new Magento 2 module in app/code/. This skill should be used when the user wants to create a module, scaffold a new module, generate module boilerplate1.3Kskills.sh installs
6tinybirdco avatartinybird-cli-guidelinestinybirdco/tinybird-agent-skillsTinybird CLI commands, workflows, and operations. Use when running tb commands, managing local development, deploying, or working with data operations.1.3Kskills.sh installs