Copilot OTel file exporter writes spans as empty objects and drops captureContent attributes
@rwoll is already working on this.
Since Sep 17, 2026.
Assessment
This issue has not been assessed yet.
Description
- Copilot Chat Extension Version: 0.51.0
- VS Code Version: 1.123.0
- OS Version: macOS
- Feature (e.g. agent/edit/ask mode): Agent mode / Copilot Chat OpenTelemetry file exporter
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): GPT-5.2-Codex
- Logs:
The Copilot Chat runtime log confirms that OpenTelemetry is enabled with file export and content capture:
[OTel] Instrumentation enabled — exporter=file ... captureContent=true
My VS Code settings are:
"github.copilot.chat.otel.enabled": true,
"github.copilot.chat.otel.exporterType": "file",
"github.copilot.chat.otel.outfile": "/tmp/copilot-otel.jsonl",
"github.copilot.chat.otel.captureContent": true
The generated /tmp/copilot-otel.jsonl contains log and metric records such as:
gen_ai.usage.input_tokens
gen_ai.usage.output_tokens
gen_ai.request.model
gen_ai.response.model
copilot_chat.tool.call
gen_ai.tool.name
traceId
spanId
However, the content-bearing span attributes do not appear:
grep -n "gen_ai.input.messages\|gen_ai.output.messages\|gen_ai.tool.call.arguments\|gen_ai.tool.call.result" /tmp/copilot-otel.jsonl
This returns no matches.
The file also contains empty JSON objects:
{}
Based on local inspection, these empty objects appear to correspond to exported spans. Logs and metrics serialize correctly, but spans appear to be written as empty objects.
Steps to Reproduce:
- Enable Copilot Chat OpenTelemetry file export with content capture:
"github.copilot.chat.otel.enabled": true,
"github.copilot.chat.otel.exporterType": "file",
"github.copilot.chat.otel.outfile": "/tmp/copilot-otel.jsonl",
"github.copilot.chat.otel.captureContent": true
-
Reload VS Code.
-
Run a Copilot Chat / Agent mode interaction that performs at least one tool call or file edit.
-
Inspect
/tmp/copilot-otel.jsonl. -
Observe that logs and metrics are written correctly, but span records appear as
{}and content-bearing span attributes are missing.
Expected Behavior:
With github.copilot.chat.otel.captureContent set to true, I expected the file exporter to preserve span attributes such as:
gen_ai.input.messages
gen_ai.output.messages
gen_ai.tool.call.arguments
gen_ai.tool.call.result
These fields are important because they should contain prompt messages, response messages, tool-call arguments, and tool-call results.
Actual Behavior:
The JSONL file contains metadata logs and metrics, including model names, token counts, tool names, durations, trace IDs, and span IDs.
However, the content-bearing fields are missing, and spans appear to be serialized as {}.
Additional Investigation:
I inspected the bundled Copilot Chat implementation locally. The implementation appears to include the requested content attribute names and conditionally attach them when content capture is enabled.
However, the file exporter appears to serialize OpenTelemetry span objects directly. Since OpenTelemetry ReadableSpan properties are not directly JSON-enumerable, this appears to produce {} for span records.
The SQLite span exporter appears to use a proper span-conversion path, so this may be specific to the file exporter.
Question:
Is this expected behavior for the file exporter, or should it serialize spans in the same way as the SQLite/OTLP exporters?
If this is a bug, I would be willing to help test a fix or submit a PR if maintainers confirm the expected serialization path.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·