跳到正文
cccskills
免费在 GitHub 公开

langfuse-metrics

Query aggregate Langfuse cost, volume, latency, and model telemetry efficiently with Metrics API v2. Use for dashboards, rollout checks, usage summaries, and cost or latency comparisons; use Observations API v2 instead when individual rows are actually required.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(3)

  • SKILL.md3.6 KB
  • agents/openai.yaml239 B
  • scripts/query-metrics-v2.mjs8.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Langfuse Metrics

Prefer one bounded GET /api/public/v2/metrics query over downloading and aggregating observations. Metrics queries return aggregates and avoid exposing prompt or output content.

Use scripts/query-metrics-v2.mjs:

node .codex/skills/langfuse-metrics/scripts/query-metrics-v2.mjs summary --from 2026-08-26T00:00:00Z --model-prefix gpt-5.6-
node .codex/skills/langfuse-metrics/scripts/query-metrics-v2.mjs cost-report --from 2026-08-26T00:00:00Z --to 2026-08-27T00:00:00Z --completed-meetings 12 --transcribed-minutes 347
node .codex/skills/langfuse-metrics/scripts/query-metrics-v2.mjs query --file query.json

The helper reads LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, and optional LANGFUSE_BASE_URL (Chronote defaults to the US cloud host). summary makes a single request grouped by provided model and observation name, returning count, total cost, average latency, and p95 latency. Use --dry-run to inspect the query without sending it. --model-prefix is sent as a Metrics v2 starts with filter so matching happens before the server's 1,000-row limit.

cost-report uses that same single aggregate query to return attributed cost, cost by model and feature, known fully-unpriced model groups, and group-based cost coverage. Pass PostHog's completed-meeting count and the application's transcribed-minute denominator when available to add unit costs. Do not call the coverage ratio exact: a group with some cost may still contain individual unpriced observations. Keep any unpriced TTS, image, or provider activity visible rather than estimating dollars from unrelated units.

Keep queries bounded with explicit UTC fromTimestamp and toTimestamp. Start with the dimensions and metrics needed to answer the question; do not add time buckets or high row limits speculatively. Metrics API v2 supports at most 1,000 rows and does not permit grouping by high-cardinality identifiers such as trace, session, or user IDs.

Before interpreting an empty result as no traffic, check ingestion freshness. Data from Langfuse Python SDK versions before 4.7 or JS/TS versions before 5.4 can appear in v2 endpoints up to 15 minutes late.

If row-level investigation is necessary, use GET /api/public/v2/observations with bounded fromStartTime and toStartTime, selective fields, and cursor pagination. Do not use deprecated /api/public/observations or page-based pagination. Omit the io field group unless the task genuinely requires user content and that access is authorized.

On HTTP 429, honor Retry-After. The helper retries once only when the wait is 60 seconds or less; otherwise it stops and reports the wait. Do not work around an organization-wide quota by rotating project keys. Langfuse applies rate limits to organization-level resource buckets shared by its projects and keys.

Aggregate health does not prove output quality. Report routing/configuration, traffic, latency, cost, and error evidence separately from representative workload or human quality validation. This skill is read-only and does not authorize prompt, model-routing, evaluator, or production configuration writes.

Current official references:

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Analyze Chronote product adoption with PostHog and Langfuse, including active users, meetings, feature usage, AI telemetry, and privacy-safe resolution of active Discord guild IDs to live server names.

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

Use when a change affects user-visible behavior at docs.chronote.gg and needs public documentation. Covers where docs live (apps/docs-site vs docs/), authoring checklist, yarn docs:check, and Algolia config. Trigger when the user mentions docs, release notes, what's-new, or user-facing PR changes.

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

Investigate errors, incidents, or product ideas using both internet research and repo-wide codebase research, then propose a concrete changeset plan with clarifying questions before any implementation. Use when a user asks to investigate, root-cause, or plan changes, or when an Issue or PR is referenced and needs a plan.

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

Configure and debug MCP servers for Claude Code, OpenCode, and Codex CLI, including auth headers, scope, and validation checks. Use when MCP tools fail to connect, when an MCP server returns 401/404/HTML, or when adding a new MCP server to this repo.

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

Configure and debug MCP servers for OpenCode, Codex CLI, and Claude Code, including auth headers, scope, and validation checks. Use when MCP tools fail to connect or when adding a new MCP server.

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

Use every time you push a commit to an active pull request, to verify the PR is truly stable before reporting merge readiness. Covers the post-push wait window, AI review audit (Copilot/Greptile/Codex), and the gh commands to snapshot PR state. Trigger on "I pushed" or "is the PR ready to merge".

中文简介正在准备中。当前显示原文说明。

Chronote-gg/Chronote42026年10月22日 更新

查看 Chronote-gg 的全部技能

报告此技能的问题