Add OpenTelemetry instrumentation infrastructure for observability#3424
Draft
Add OpenTelemetry instrumentation infrastructure for observability#3424
Conversation
Co-authored-by: zhichli <57812115+zhichli@users.noreply.github.com>
Co-authored-by: zhichli <57812115+zhichli@users.noreply.github.com>
Co-authored-by: zhichli <57812115+zhichli@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add OpenTelemetry instrumentation for vscode copilot chat agent
Add OpenTelemetry instrumentation infrastructure for observability
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds OpenTelemetry-based observability infrastructure for VS Code Copilot Chat agent, modeled after Gemini CLI's telemetry system.
Changes
Core Service Interface
IOpenTelemetryServicewith typed attributes for tool calls, API requests, agent lifecycle, file operationsNullOpenTelemetryServicefor zero-overhead disabled stateFileOpenTelemetryServicewrites JSON lines to configurable output fileConfiguration
New settings under
github.copilot.chat.openTelemetry.*:enabled,target,otlpEndpoint,otlpProtocol,outfile,logPromptsPrivacy-first:
logPrompts: false(default) excludes user prompts from telemetry.Event Types
Usage
{ "github.copilot.chat.openTelemetry.enabled": true, "github.copilot.chat.openTelemetry.outfile": "~/.copilot/telemetry.log" }Output format (JSON lines):
{"timestamp":"...","type":"log","name":"copilot_chat.tool_call","attributes":{"function_name":"read_file","success":true,"tool_type":"native"},"common":{"session.id":"...","installation.id":"..."}}Files
src/platform/telemetry/common/openTelemetryService.ts- Interface + typessrc/platform/telemetry/common/nullOpenTelemetryService.ts- Disabled implsrc/platform/telemetry/node/fileOpenTelemetryService.ts- File output implsrc/platform/telemetry/vscode-node/openTelemetryServiceImpl.ts- Config-aware wrappersrc/extension/extension/vscode-node/services.tsNot Included
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.