بنقرة واحدة
aiconfig-ai-metrics
Guide for instrumenting AI metrics tracking in an existing codebase using LaunchDarkly SDK.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide for instrumenting AI metrics tracking in an existing codebase using LaunchDarkly SDK.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create a new LaunchDarkly AI Config with variations, model configurations, and targeting. Use this skill to programmatically create AI Configs for agent or completion mode.
Configure LaunchDarkly AI Config targeting rules via API to control which users receive specific variations. Enable A/B tests, percentage splits, segment targeting, and multi-context rules.
Create, manage, and attach tools (functions) to LaunchDarkly AI Configs. Tools enable AI agents to interact with external systems, APIs, and databases.
Manage AI Config variations - add, update, retrieve, and delete variations from existing configs. Test different models, prompts, parameters, and tools within a single AI Config.
Access LaunchDarkly AI Configs through the REST API. Learn how to authenticate and perform operations not available through SDKs.
Build safe, scalable contexts for LaunchDarkly AI Configs with cardinality controls, multi-context patterns, and agent graph attributes.
| name | aiconfig-ai-metrics |
| description | Guide for instrumenting AI metrics tracking in an existing codebase using LaunchDarkly SDK. |
| metadata | {"author":"launchdarkly","version":"0.4.0"} |
This skill guides you through adding AI metrics tracking to a codebase. Your job is to explore, assess, and implement the right instrumentation strategy for this specific codebase.
Before implementing anything, understand what you're working with:
openai, anthropic, bedrock, langchain, etc.)completion_config(), agent_config())Based on exploration, determine:
| Question | Why It Matters |
|---|---|
| Which AI provider(s)? | Determines tracking method (automatic vs manual) |
| Streaming or batch? | Streaming requires TTFT tracking |
| AI Config already in use? | If not, see aiconfig-sdk skill first |
| Centralized or scattered calls? | Affects instrumentation strategy |
| Error handling in place? | Need to add track_error() calls |
Based on your assessment, select the appropriate reference:
| Situation | Reference |
|---|---|
| OpenAI calls (non-streaming) | references/openai-tracking.md |
| Anthropic calls | references/anthropic-tracking.md |
| AWS Bedrock | references/bedrock-tracking.md |
| Streaming responses | references/streaming-tracking.md |
| Need to query metrics data | references/metrics-api.md |
Follow the chosen reference to implement tracking. Key principles:
config.enabled before making tracked callsConfirm your instrumentation is working:
The config.tracker object provides these methods:
| Method | Use Case |
|---|---|
track_openai_metrics(fn) | Automatic tracking for OpenAI |
track_bedrock_converse_metrics(res) | Automatic tracking for Bedrock |
track_duration_of(fn) | Wrap any callable to track duration |
track_tokens(TokenUsage) | Manual token tracking |
track_duration(int) | Manual duration (ms) |
track_time_to_first_token(int) | TTFT for streaming (ms) |
track_success() | Mark successful |
track_error() | Mark failed |
aiconfig-sdk - SDK setup (prerequisite if not already configured)aiconfig-custom-metrics - Business metrics beyond AI metricsaiconfig-online-evals - Automatic quality evaluation