官方更新 GitHub Changelog Fri, 07 Aug 2026 正文 ok 386 words

Copilot 使用指标 API 新增 Agent 应用活动数据

英文标题:Copilot usage metrics API adds agent app activity

GitHub 的 Copilot 使用指标 API 现可按单个 Agent 应用报告活动数据,覆盖企业、组织、企业用户和组织用户的 1 天及 28 天报告。新增的可选 `totals_by_3rd_party_agent` 数组可提供 Agent 名称、稳定 ID、用户发起的交互次数,以及部分聚合报告中的会话数。该更新让团队能够区分 Copilot coding agent 与 Claude、Codex 等其他 Agent 的使用情况,为 Agent 推广、采用率比较和许可证决策提供实际数据依据。该变更向后兼容,且需要启用 Copilot 使用指标策略并具备相应权限才能访问。
打开原文相关 10 · 机会 8
media16.2 KB media124.7 KB

中文

自从 Agent 应用登陆 GitHub 后,团队便能够直接在 GitHub 工作流中运行来自 Claude 和 Codex 等合作伙伴的 Agent。Copilot 使用指标 API 现在会报告这些活动,并按单个 Agent 细分。使用指标 API 会在企业、组织、企业用户和组织用户的 1 天及 28 天报告中提供这些数据。

新增的可选 totals_by_3rd_party_agent 数组会为每个已识别的 Agent 应用包含一个条目。每个条目包括:

  • agent_name:Agent 的显示名称。显示名称可能发生变化,因此应基于 agent_id 而非此字段进行分组。
  • agent_id:Agent 的稳定标识符,也是跨报告周期进行关联的正确键。
  • user_initiated_interaction_count:由用户发起的 Agent 应用任务启动次数。
  • session_count:Agent 应用会话数量。仅包含在聚合的企业和组织报告中;按用户划分的条目会省略此字段。

此前,使用指标中的 Agent 活动实际上被归入单一类别,因此无法区分 Copilot coding agent 的工作与通过其他 Agent 完成的工作。随着团队采用多个 Agent,这使得一些基本问题难以回答:实际使用的是哪些 Agent、有多少人在使用,以及新推出的 Agent 的采用情况与其旨在补充的 Agent 相比如何。

按 Agent 拆分活动数据后,你可以分别跟踪每个 Agent 应用、比较它们之间的采用情况,并依据真实使用数据而非假设来制定推广和许可证决策。

  • 嵌套的 user_initiated_interaction_count 用于统计 Agent 应用任务启动次数。它与同名的顶层字段不同:顶层字段统计来自其他受支持遥测数据的显式提示。不要将两者相加,也不要将它们视为可互换的指标。
  • 活动按 Agent 聚合,因此属于同一 Agent 的多个应用会合并为一个条目。无法识别的 Agent 所产生的活动将被省略。
  • 企业所有者和计费管理员、组织所有者,以及拥有授予 View Copilot Metrics 权限的自定义组织或企业角色的任何人,均可使用这些指标。必须启用 Copilot 使用指标策略。
  • 此项变更向后兼容。现有字段会保持当前结构;如果报告周期内没有已识别的 Agent 应用活动,报告将完全省略 totals_by_3rd_party_agent。

访问 Copilot 使用指标 API 文档 开始使用,或查看 Agent 应用指标字段 以了解完整的字段定义。

English / 原文

Since agent apps arrived on GitHub, teams have been able to run agents from partners like Claude and Codex directly in their GitHub workflows. The Copilot usage metrics API now reports that activity, broken out by individual agent. The usage metrics API does this in the enterprise, organization, enterprise-user, and organization-user 1-day and 28-day reports.

A new optional totals_by_3rd_party_agent array contains one entry per recognized agent app. Each entry includes:

  • agent_name : The agent’s display name. Display names can change, so group on agent_id rather than this field.
  • agent_id : The agent’s stable identifier, and the right key for joining across reporting periods.
  • user_initiated_interaction_count : The number of user-initiated agent app job starts.
  • session_count : The number of agent app sessions. Included in the aggregated enterprise and organization reports only. Per-user entries omit this field.

Until now, agent activity in your usage metrics was effectively a single bucket, so there was no way to tell Copilot coding agent work apart from work done through other agents. As teams adopt more than one agent, that made it hard to answer basic questions: which agents are actually being used, by how many people, and how does adoption of a newly rolled-out agent compare to the one it was meant to supplement.

Breaking activity out per agent lets you distinctly track each agent app, compare adoption across them, and ground rollout and licensing decisions in real usage rather than assumption.

  • The nested user_initiated_interaction_count counts agent app job starts. It is distinct from the top-level field of the same name, which counts explicit prompts from other supported telemetry. Do not sum the two or treat them as interchangeable.
  • Activity is aggregated by agent, so multiple apps belonging to the same agent are collapsed into one entry. Activity from agents that cannot be identified is omitted.
  • These metrics are available to enterprise owners and billing managers, organization owners, and anyone with a custom organization or enterprise role that grants the View Copilot Metrics permission. The Copilot usage metrics policy must be enabled.
  • The change is backward compatible. Existing fields keep their current shape, and reports omit totals_by_3rd_party_agent entirely when there is no recognized agent app activity for the reporting period.

Visit the Copilot usage metrics API documentation to get started, or see Agent apps metrics fields for the full field definitions.