Token导航 LogoToken导航

Agent Skill · 研究检索

aiconfig-ai-metrics(aiconfig ai 指标)

aiconfig-ai-metrics 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

aiconfig-ai-metrics 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,674 个 Skill 里排第 39,449。

总安装 1,411周安装 60GitHub Stars 7下载 494核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:aiconfig-ai-metrics(aiconfig ai 指标)
来源仓库:https://github.com/launchdarkly/agent-skills
仓库路径:skills/aiconfig-ai-metrics
安装命令:
npx skills add https://github.com/launchdarkly/agent-skills --skill aiconfig-ai-metrics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/launchdarkly/agent-skills --skill aiconfig-ai-metrics

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

aiconfig-ai-metrics 为 LaunchDarkly AI 指标埋点提供标准化接入方案。适用于需要监控 LLM 调用时长、令牌数与成功率的应用场景。根据调用类型选择合适层级实现,优先采用高兼容度方案减少代码侵入。

需配合 SDK 使用,默认记录 duration、tokens、success/error 等核心指标。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/aiconfig-ai-metrics

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/launchdarkly/agent-skills --skill aiconfig-ai-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

aiconfig-ai-metrics 怎么安装?

在终端执行 npx skills add https://github.com/launchdarkly/agent-skills --skill aiconfig-ai-metrics。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

aiconfig-ai-metrics 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

aiconfig-ai-metrics 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

aiconfig-ai-metrics 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

aiconfig-ai-metrics 用的人多吗?

公开数据是累计安装 1,411 次,近一周安装 60 次,下载 494 次,GitHub 7 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

aiconfig-ai-metrics 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
aiconfig-ai-metrics

aiconfig ai 指标 · 本页

1,4117接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

AI Metrics Instrumentation

You're using a skill that wires LaunchDarkly AI 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:

TierPatternUse whenTracks automatically
1 — Managed runnerPython: ai_client.create_model(...) returning a ManagedModel, then await model.invoke(...). Node: aiClient.initChat(...) / aiClient.createChat(...) returning a TrackedChat, then await chat.invoke(...).The call is conversational (chat history, turn-based). This is what the provider READMEs lead with.Duration, tokens, success/error — all of it, zero tracker calls.
2 — Provider package + trackMetricsOftracker.trackMetricsOf(Provider.getAIMetricsFromResponse, () => providerCall()). Provider packages today: @launchdarkly/server-sdk-ai-openai, -langchain, -vercel (Node) and launchdarkly-server-sdk-ai-openai, -langchain (Python).The shape isn't a chat loop (one-shot completion, structured output, agent step) but the framework or provider has a package.Duration + success/error from the wrapper; tokens from the package's built-in getAIMetricsFromResponse extractor.
3 — Custom extractor + trackMetricsOfSame trackMetricsOf wrapper, but you write a small function that maps the provider response to LDAIMetrics (tokens + success).No provider package exists (Anthropic direct, Gemini, Cohere, custom HTTP).Duration + success/error from the wrapper; tokens from your extractor.
4 — Raw manualSeparate calls to trackDuration, trackTokens, trackSuccess / trackError, plus trackTimeToFirstToken for streams.Streaming with TTFT, unusual response shapes, partial tracking, anything Tier 2–3 can't cleanly wrap.Only what you explicitly call — it's on you to not miss one.

A call to track_openai_metrics / trackOpenAIMetrics / track_bedrock_converse_metrics / trackBedrockConverseMetrics / trackVercelAISDKGenerateTextMetrics is Tier-2 legacy shorthand. These helpers still exist in the SDK source but none of the current provider READMEs use them — they've been superseded by trackMetricsOf + Provider.getAIMetricsFromResponse. Do not recommend them for new code; if you see them in an existing codebase, leave them alone unless the user is already on a cleanup pass.

Workflow

1. Explore the existing call site

Before picking a tier, find the provider call and answer these questions:

  • Shape? Is it a chat loop (history + turn-based), a one-shot completion, an agent step, or something else? → drives Tier 1 vs 2.
  • Framework? Raw provider SDK? LangChain / LangGraph? Vercel AI SDK? CrewAI? Strands? → drives which Tier-2 provider package (if any) applies.
  • Provider? OpenAI, Anthropic, Bedrock, Gemini, Azure, custom HTTP? → cross-reference with the package availability matrix below.
  • Streaming? If yes, you'll need TTFT tracking, which means Tier 4 for the TTFT part even if the rest is Tier 2.
  • Language? Python or Node? Provider-package coverage differs between them.
  • Already using an AI Config? If not, route to aiconfig-create first — tracking requires a tracker, which is obtained by calling create_tracker() / createTracker() on the config object returned by completion_config() / completionConfig() / initChat().

2. Look up your Tier-2 option

Use this matrix to decide whether Tier 2 (provider package) is available for your situation. If it's not, drop to Tier 3 (custom extractor). If the shape is chat-loop, go to Tier 1 first regardless of what's in this matrix.

Framework / providerPython provider packageNode provider packageReference
OpenAI (direct SDK)launchdarkly-server-sdk-ai-openai@launchdarkly/server-sdk-ai-openaiopenai-tracking.md
LangChain / LangGraphlaunchdarkly-server-sdk-ai-langchain@launchdarkly/server-sdk-ai-langchainlangchain-tracking.md
Vercel AI SDK—@launchdarkly/server-sdk-ai-vercel(use the Vercel provider docs)
AWS Bedrock (Converse or InvokeModel)— (use LangChain-aws or custom extractor)— (use LangChain-aws or custom extractor)bedrock-tracking.md
Anthropic direct SDK——anthropic-tracking.md
Gemini / Google GenAI——gemini-tracking.md
Strands Agents— (Tier 3 custom extractor)— (Tier 3 custom extractor)strands-tracking.md
Cohere, Mistral, custom HTTP——Tier 3 custom extractor
Any provider, streaming + TTFT— (Tier 4 only)trackStreamMetricsOf (no TTFT) + manual TTFTstreaming-tracking.md

3. Implement from the matching reference

Once you know the tier and the provider, open the reference file and follow the pattern. The references are written so Tier 1 is always the first example, Tier 2/3 next, and Tier 4 last. Stop at the first tier that matches the app's shape.

Guardrails that apply to every tier:

  1. Always check config.enabled before making the tracked call. A disabled config means the user has flagged the feature off — you should short-circuit to whatever fallback the app uses (cached response, error, degraded path) rather than making the provider call at all.
  2. Wrap the existing call, don't rewrite it. Tier 2 and Tier 3 are designed to slot around an unmodified provider call. If you find yourself rewriting the call to fit the tracker, you're at the wrong tier — drop down one.
  3. Errors are handled inside trackMetricsOf. The wrapper catches exceptions, records trackError() internally, and re-raises — do not add except: tracker.trackError() on top, it's a noop that also trips the at-most-once guard. Tier 1 handles both paths automatically. At Tier 4 (manual, streaming, track_duration_of) the caller does own the error-tracking call.
  4. Always flush before close. Call ldClient.flush() (Python: ldclient.get().flush(); Node: await ldClient.flush()) before closing the client. Trailing events are at risk of being lost otherwise — in short-lived scripts and long-running services alike. In Node, ldClient.close() returns a Promise; await it.

4. Verify

Confirm the Monitoring tab fills in:

  • Run one real request through the instrumented path.
  • Open the AI Config in LaunchDarkly → Monitoring tab. Duration, token counts, and generation counts should appear within 1–2 minutes.
  • Force an error (bad API key, zero max_tokens, whatever) and confirm the error count increments.
  • If streaming: verify TTFT appears. If it doesn't, you probably wrapped the stream creation with trackMetricsOf but didn't add the manual trackTimeToFirstToken call — see streaming-tracking.md.

Quick reference: tracker methods

Obtain a tracker via the factory on the config object: tracker = config.create_tracker() (Python v0.18.0+) or const tracker = aiConfig.createTracker!() (Node v0.17.0+). Call the factory once per execution and reuse the returned tracker for every call — each factory invocation mints a new runId that tags every tracking event emitted by that tracker so events from a single execution can be correlated together (via exported events / downstream systems). The Monitoring tab aggregates events rather than grouping them by run today — the runId is useful when events are exported or queried outside the UI, and is the identifier the SDK's at-most-once guards are keyed on. The methods below are the raw API surface — most of the time you should not call them individually; use trackMetricsOf or a Tier-1 managed runner. The list is here so you can recognize the methods in existing code and reach for the right one when you genuinely need Tier 4.

Method (Python ↔ Node)TierWhat it does
track_metrics_of(extractor, fn) / trackMetricsOf(extractor, fn)2 / 3Wraps a provider call, captures duration + success/error, calls your extractor for tokens. This is the default generic tracker.
track_metrics_of_async(extractor, fn) (Python)2 / 3Async variant of the above.
trackStreamMetricsOf(extractor, streamFn) (Node only)2 / 3Streaming variant. Captures per-chunk usage when the extractor handles chunks. Does not auto-capture TTFT.
track_duration(ms) / trackDuration(ms)4Record latency in milliseconds.
track_duration_of(fn) / trackDurationOf(fn)4Wraps a callable and records duration automatically. Does not capture tokens or success — pair with explicit calls.
track_tokens(TokenUsage) / trackTokens({input, output, total})4Record token usage.
track_time_to_first_token(ms) / trackTimeToFirstToken(ms)4Record TTFT for streaming responses.
track_success() / trackSuccess()4Mark the generation as successful. Required for the Monitoring tab to count it.
track_error() / trackError()4Mark the generation as failed. Do not also call trackSuccess() in the same request.
track_feedback({kind}) / trackFeedback({kind})anyRecord thumbs-up / thumbs-down from a feedback UI. Independent of the success/error path.
track_tool_call(name) / trackToolCall(name)anyRecord a single tool invocation by name. Available on both SDKs as of Python v0.18.0 / Node v0.17.0.
track_tool_calls([names]) / trackToolCalls([names])anyBatch variant — record a list of tool invocations in one call.
track_judge_result(result) / trackJudgeResult(result)anyRecord a programmatic judge evaluation (consolidates the earlier track_eval_scores + track_judge_response pair). result.sampled indicates whether evaluation ran.
track_openai_metrics(fn) / trackOpenAIMetrics(fn)legacyPredates provider packages. Still works; do not use in new code. Replace with trackMetricsOf(OpenAIProvider.getAIMetricsFromResponse, fn).
track_bedrock_converse_metrics(res) / trackBedrockConverseMetrics(res)legacySame story. Do not use in new code.
trackVercelAISDKGenerateTextMetrics(fn) (Node)legacySame story. Use trackMetricsOf with the Vercel provider package's extractor.

Related skills

  • aiconfig-create — prerequisite if the app doesn't have an AI Config yet
  • aiconfig-custom-metrics — business metrics (conversion, resolution, retention) layered on top of the AI metrics this skill captures
  • aiconfig-online-evals — automatic quality scoring (LLM-as-judge) on sampled live requests; complementary to the metrics here
  • aiconfig-migrate — Stage 4 of the hardcoded-to-AI-Configs migration delegates to this skill

平台分布

Codex

35.83%
按下载量换算177

Claude

30.22%
按下载量换算149

Cursor

20.38%
按下载量换算101

Gemini CLI

9.63%
按下载量换算48

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills