豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Add OTel metrics for edit acceptance and code survival telemetry#4792

Merged
zhichli merged 1 commit intomainfrom
users/digitarald/otel-edit-survival-metrics
Mar 28, 2026
Merged

Add OTel metrics for edit acceptance and code survival telemetry#4792
zhichli merged 1 commit intomainfrom
users/digitarald/otel-edit-survival-metrics

Conversation

@digitarald
Copy link
Copy Markdown
Contributor

Summary

Adds OpenTelemetry counters and histograms for edit acceptance and code survival across inline chat and chat editing sessions, supplementing existing MSFT/GH telemetry.

Changes

New OTel metrics (4 instruments):

  • copilot_chat.edit.acceptance.count — counter for accept/reject of inline chat and chat editing hunks
  • copilot_chat.chat_edit.outcome.count — counter for chat editing session outcomes (accepted/rejected/saved)
  • copilot_chat.edit.survival.four_gram — histogram for 4-gram text similarity survival scores
  • copilot_chat.edit.survival.no_revert — histogram for no-revert survival scores

GitHub telemetry additions:

  • sendGHTelemetryEvent for inline.done and inline.trackEditSurvival (previously MSFT-only)

Type safety:

  • EditSource and EditOutcome union types enforce valid attribute values at compile time
  • All attribute keys use copilot_chat.* namespace via CopilotChatAttr constants

Files changed

  • genAiAttributes.ts — attribute constants + union types
  • genAiMetrics.ts — 4 new static metric methods
  • userActions.ts — wiring at 4 call sites + GH telemetry
  • agentTraceHierarchy.spec.ts — 2 new tests (happy path + edge case)

@digitarald digitarald requested a review from zhichli March 28, 2026 01:55
@zhichli zhichli marked this pull request as ready for review March 28, 2026 02:49
@zhichli zhichli requested review from Copilot and removed request for Copilot March 28, 2026 02:49
@zhichli zhichli added this pull request to the merge queue Mar 28, 2026
Merged via the queue into main with commit 111403d Mar 28, 2026
23 checks passed
@zhichli zhichli deleted the users/digitarald/otel-edit-survival-metrics branch March 28, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants