feat(otel): allow Copilot CLI agents to enrich native spans with delivery context
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- shell
- 領域
- cli, observability
研究方向
No implementation files, tests, or entry points are named; first locate the Copilot CLI runtime code responsible for creating and exporting native OpenTelemetry spans. Review how context reaches invoke_agent, chat, and execute_tool spans. Done means a governed pre-export hook supports allow-listed, constrained, privacy-controlled attributes with clear provenance and consistent application.
由索引模型根據 Issue 內容生成。
描述
Problem
Copilot CLI emits useful native OpenTelemetry spans for agent activity, model calls, and tool execution. The observed spans already include gen_ai.* and github.copilot.* data such as conversation IDs, model selection, tool names, and input/output/cache/reasoning token usage.
However, the agent/model cannot enrich those native spans with delivery context. Span creation and export belong to the Copilot CLI runtime, and Copilot CLI currently exposes no supported agent/runtime API or hook to set attributes on its native OTEL spans. Custom instructions, custom agents, MCP servers, and tools cannot reliably fill this gap.
Requested capability
Provide a governed runtime API/hook that allows a Copilot CLI agent (or approved integration) to add allow-listed custom attributes to native Copilot CLI OTEL spans before export.
Illustrative API:
on_span_created(span)
span.set_attribute(key, value)
Goal and use cases
Enable end-to-end correlation of AI-assisted engineering activity with work items, Git changes, and delivery outcomes. An enriched trace/span should support data points such as:
workitem.id
vcs.repository.url.full
vcs.repository.ref.name
vcs.repository.ref.revision
gitlab.merge_request.id
ai.session.id
gen_ai.conversation.id
gen_ai.request.model
gen_ai.response.model
gen_ai.usage.input_tokens
gen_ai.usage.output_tokens
gen_ai.usage.cache_read.input_tokens
gen_ai.usage.cache_write.input_tokens
gen_ai.usage.reasoning.output_tokens
gen_ai.tool.name
The primary correlation key is repository identity plus commit SHA. That joins Copilot traces to Git commits, merge requests, pipelines, artifacts, deployments, and production outcomes. Ticket and session identifiers provide supporting context. The capability should also support integrations with ticketing systems and approved software-supply-chain/provenance standards.
Requirements
- Attribute mutations occur in the CLI runtime before export, not through model prompting alone.
- Allow-list attribute keys and constrain types, value sizes, and cardinality.
- Support privacy/redaction controls and organization policy.
- Make provenance clear: identify whether an attribute was supplied by the runtime, agent, or integration.
- Apply configured context consistently to relevant native spans, including
invoke_agent,chat, andexecute_tool. - Preserve existing OTEL semantic conventions where applicable, especially
vcs.*andgen_ai.*.
Workaround
An OpenTelemetry Collector or OTLP proxy can enrich exported spans externally today. This works for process-wide Git/Jira context, but does not provide agent-aware, per-span enrichment at the point where Copilot CLI creates the spans.
Observed version
GitHub Copilot CLI 1.0.88.
- 主要語言
- Shell
- 星號
- 11.2k
- 分支
- 1.9k
- 平均合併
- 17 小時 6 分鐘
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/copilot-cli 的其他 Issue
-
area:sessions
難度 2/5 1-3 小時 新手友好度 72/100
github/copilot-cli#4996 ·
維護者通常 1 天內回覆
-
triage
難度 1/5 1 小時以內 新手友好度 88/100
github/copilot-cli#4963 · 1 則留言 ·
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 75/100
github/copilot-cli#4932 ·
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 78/100
github/copilot-cli#4909 ·
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 76/100
github/copilot-cli#4906 ·
維護者通常 1 天內回覆
查看 github/copilot-cli 的全部 Issue
相似的 Issue
-
Feature Needs Triage
難度 2/5 1-3 小時 新手友好度 72/100
project-chip/certification-tool#1154 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
beehive-lab/TornadoVM#1151 ·
維護者通常 1 天內回覆
-
component/tests
難度 2/5 1-3 小時 新手友好度 72/100
NVIDIA/nodewright#735 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
obra/superpowers#2433 ·
維護者通常 5 天內回覆