Copilot Chat OpenTelemetry Instrumentation
A repository-specific guide for consistent OpenTelemetry instrumentation in Copilot Chat.
The skill specifies use of the IOTelService abstraction, truncation, captureContent gating, hashing of sensitive identifiers, and Debug Panel/OTLP isolation, while documenting process-environment and SDK-internal-access risks. It lacks per-change user confirmation, an explicit rollback procedure, and dependency security verification, so full marks are not justified.
It provides architecture maps, operation conventions, graceful-degradation requirements, configuration-sync checklists, unit-test guidance, and validation commands. However, this review is static, the referenced implementation files and test results are not included, and runtime/error-path reproducibility is unproven; the score remains within the static ceiling.
The audience, trigger scenarios, four agent paths, and rejected patterns are clearly described. Non-fit boundaries, formal input/output contracts, and Chinese-language support are limited. The core skill is not entirely dependent on overseas services, but referenced external monitoring backends may have reachability differences, warranting a deduction.
The document uses progressive sections, tables, code examples, and procedural checklists, with MIT licensing and Microsoft repository provenance available as governance evidence. It lacks a skill-specific version, changelog, explicit maintenance owner, update path, and complete installation/troubleshooting guidance.
The skill offers directly usable guidance for core OTel instrumentation work, including architecture, naming, content handling, synchronization, and validation steps. Its usefulness depends on additional source and monitoring documents not supplied here, and no end-to-end output evidence is present, so the static maximum applies.
Specific source paths, test locations, CI-related validation commands, and known risks make the guidance partially auditable. No executed test results or independent corroboration are included, so static calibration limits this to 5.
- No TypeScript checks, unit tests, or Aspire/Agent Debug Log end-to-end validation were executed.
- Before adoption, verify that the referenced source paths, exporter filters, content-capture settings, and SDK internal fields match this revision.
- Telemetry may contain prompts, tool arguments, session identifiers, or model responses; confirm that captureContent, truncation, hashing, and exporter policies meet organizational privacy requirements.
- If the monitoring backend or dependencies require overseas network access, provide a reachable, proxied, or offline alternative for mainland-China users.
What it does & when to use it
This skill guides OpenTelemetry work in the Copilot Chat extension within the Visual Studio Code repository. It covers four agent execution paths: the foreground agent, in-process Copilot CLI, terminal Copilot CLI, and Claude Code, along with IOTelService and span, metric, event, and propagation conventions. Implementation changes are expected to stay synchronized with the user monitoring documentation, architecture documentation, and tests. It is best suited to developers maintaining telemetry in this codebase, rather than to users seeking a general-purpose OpenTelemetry tutorial or standalone runtime.
It requires reading agent_monitoring.md and agent_monitoring_arch.md before changing telemetry and updating the relevant documentation in the same change. It specifies how to create invoke_agent, chat, execute_tool, and execute_hook spans through IOTelService, use constants from genAiAttributes.ts, and choose between truncation and captureContent gating for content attributes. It documents the Copilot CLI Bridge SpanProcessor, Claude SDK message-to-GenAI span synthesis, cross-boundary trace propagation, and the separation between OTLP, file, SQLite, and debug-panel outputs. It also requires synchronized updates to settings, environment-variable translation, exportable operation names, and unit tests, with TypeScript, OTel/Bridge test, and manual dashboard/debug-panel checks.
- A developer maintaining foreground Copilot Chat agents needs consistent invoke_agent, tool, and hook span names, attributes, and error-status handling.
- A maintainer changing the in-process Copilot CLI needs to preserve the Bridge SpanProcessor, span hierarchy, traceparent handling, and hook context.
- A developer modifying Claude subprocess telemetry needs to synthesize spans from SDK messages and record chat spans through the local language-model server.
- A contributor adding a metric, event, attribute, or OTel setting needs to update the public exports, monitoring documentation, and matching tests.
- A maintainer investigating differences between Agent Debug Log and OTLP or SQLite output needs to verify EXPORTABLE_OPERATION_NAMES and the debug-panel isolation rules.
Pros & cons
- It is specific to the Copilot Chat extension in the VS Code repository, naming concrete files, classes, attribute namespaces, and test locations.
- It distinguishes four execution models and their different strategies: direct instrumentation, CLI bridging, environment forwarding, and Claude message synthesis.
- It accounts for debug-panel, OTLP, file, and SQLite export behavior, including legacy-attribute dual emission and content-capture rules.
- It provides checklists for configuration changes, cross-boundary propagation, bridge changes, and validation.
- Its scope is tightly limited to the Copilot Chat extension described by `.github/skills/otel/SKILL.md` in microsoft/vscode; it is not presented as a general OpenTelemetry design.
- It assumes familiarity with the VS Code repository layout and internal services such as IOTelService, NodeOTelService, and the Copilot CLI bridge.
- The Copilot CLI bridge accesses the OpenTelemetry SDK v2 internal `_spanProcessors` state, creating a risk if the SDK structure changes.
- The source provides no standalone installation workflow, complete test results, or dedicated adaptation guidance for other platforms.
- The Claude SDK has no file exporter, while the CLI runtime supports only `otlp-http`; the CLI SDK's single captureContent setting affects both the debug panel and OTLP.
How to install
The source does not document a separate installer or client-registration procedure. You can check out the repository and inspect the skill with:
git clone https://github.com/microsoft/vscode.gitcd vscodecat .github/skills/otel/SKILL.md
The skill is located at .github/skills/otel/; the source does not explain how to register it with a particular Agent Skills client.
How to use
In an Agent Skills-compatible client, explicitly request a repository task covered by the skill, for example: "Follow .github/skills/otel/SKILL.md to add an execute_tool span for a new tool and update agent_monitoring.md, the architecture document, and tests." Before submitting a change, run npx tsc --noEmit --project tsconfig.json from extensions/copilot/, followed by npm test -- --grep "OTel\|Bridge"; then check the Aspire Dashboard and the VS Code Agent Debug Log. The skill defines no standalone command, script, or argument interface.