
Launchdarkly Metric Instrument
This walks you through adding LaunchDarkly track() calls to measure user actions in experiments. It detects whether you're using a server-side or client-side SDK (critical because the signatures differ), finds existing patterns in your codebase to mirror, helps you place the call in the right spot, and verifies events are flowing using the LaunchDarkly MCP server. The workflow is thorough, maybe more than you need if you already know the SDK, but genuinely useful if you're instrumenting your first metric or debugging why events aren't showing up. One thing to remember is that track() calls only count in experiments when a flag evaluation happens first, so the event can be correlated to a participant.
- skills.sh installs
- 2.3K
- GitHub stars
- 19
- last updated
- Jul 14, 2026
Install
$ npx -y skills add launchdarkly/agent-skills --skill launchdarkly-metric-instrument --agent claude-codeInstalls into .claude/skills of the current project.
Files
LaunchDarkly Metric Instrument
You're using a skill that will guide you through adding a track() call to a codebase so a LaunchDarkly metric can measure it. Your job is to detect the SDK in use, find the right place in code to add the call, write it correctly, and verify that events are reaching LaunchDarkly.
Prerequisites
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
get-metric-events— verify events are flowing after instrumentation
Optional MCP tools (enhance workflow):
get-sdk-key— retrieve the server-side SDK key for the right environment when SDK initialization is needed (get-environmentfor a client-side ID or mobile key)
Workflow
Step 1: Detect the SDK
Before writing any code, understand the LaunchDarkly setup already in this codebase.
- Search for existing
track()calls. This is the fastest signal:- Look for
ldClient.track(,.track(,ld.track( - If any exist, they tell you the SDK type, call signature, and context pattern in one shot — mirror those exactly.
- Look for
Sponsors
Details
- Repository
- github.com/launchdarkly/agent-skills
- Category
- AI & Agent Building
- First seen
- May 16, 2026
More from launchdarkly/agent-skills
All 41- Aiconfig Online Evals2.2K
- Aiconfig Targeting2.2K
- Aiconfig Ai Metrics2K
- Aiconfig Custom Metrics2K
- Aiconfig Migrate2K
- Apply2K
- Detect2K
- First Flag2K
- Launchdarkly Experiment Setup2K
- Launchdarkly Guarded Rollout2K
- Mcp Configure2K
- Plan2K
- Sdk Install2K
- Aiconfig Agent Graphs1.8K
- Aiconfig Snippets1.8K
- Agent Graphs1.3K
- Built In Metrics1.3K
- Configs Create1.3K
- Configs Targeting1.3K
- Configs Update1.3K
- Configs Variations1.3K
- Custom Metrics1.3K
- Migrate1.3K
- Online Evals1.3K