github / github/copilot-sdk

Telemetry: add an in-process span sink

オープン
#2,314 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
10.5k
フォーク
1.5k
平均マージ
1日 11時間
マージ済み PR(30日)
128

説明

`TelemetryConfig` supports `otlp-http` and `file`. Both send spans out of the process. If the app embedding the SDK already has an OpenTelemetry pipeline set up, there's no way to plug the CLI's spans straight into it.

Our stack is Microsoft Agent Framework on top of the Python SDK, running as an Azure AI Foundry hosted agent. The service sets up an OpenTelemetry tracer provider that exports to Azure Monitor, so host-side spans like agent invocations and tool execution land in Application Insights. The CLI's model and tool calls don't, since its spans have nowhere to go except back out over OTLP.

To get them in, we start a loopback HTTP server on an ephemeral port, point `otlp_endpoint` at it, decode the OTLP/JSON, and pass each span to the tracer provider the service already has. It works, but it's an HTTP server and a decoder just to move spans between two objects in the same process.

A sidecar collector was the other option we tried. It means a second exporter and resource to configure, and it doesn't help when running locally.

## What would help

Some way to receive the spans in-process. A callback, or an exporter instance supplied by the host:

```python
CopilotClient(telemetry={"exporter": my_span_exporter})
```

The exact API doesn't matter much to us. What we want is for the CLI's spans to go through the exporter and resource the host already has, instead of a second pipeline alongside it.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start at the Python SDK's TelemetryConfig and CopilotClient telemetry configuration, then trace the existing otlp-http and file span paths. Define how a host-supplied exporter or callback would receive spans and resources in process; done means the CLI's model and tool spans can use the host's existing OpenTelemetry pipeline without a loopback server or second exporter.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, python
領域
backend-api-design, observability
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。