otel

Guides OpenTelemetry instrumentation of spans, metrics, and events in the Copilot Chat extension.

10|1|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/KevinHuangIsLearning/shortestpath-ide --skill otel-kevinhuangislearning
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: otel
Source: https://github.com/KevinHuangIsLearning/shortestpath-ide/tree/main/.github/skills/otel
Command: npx skills add https://github.com/KevinHuangIsLearning/shortestpath-ide --skill otel-kevinhuangislearning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding or changing OpenTelemetry telemetry in the Copilot Chat extension requires knowing four different agent execution paths, strict attribute naming conventions, and two monitoring docs that must stay in sync with the code. This Skill encodes those rules so instrumentation changes are consistent and complete. ## Core Features & Use Cases - Architecture map: Documents the four agent execution paths (foreground, Copilot CLI in-process, Copilot CLI terminal, Claude Code) and which OTel strategy each uses, plus a canonical file map of the otel platform layer. - Conventions and checklists: Enforces span/metric/event naming via genAiAttributes.ts constants, dual-emit rules for legacy copilot_chat.* attributes, content-capture gating, and step-by-step procedures for adding spans, metrics, events, or new agent surfaces. - Use Case: When adding a new execute_tool span attribute, the Skill directs you to define the constant in genAiAttributes.ts, truncate values with truncateForOTel, update EXPORTABLE_OPERATION_NAMES if needed, and document the attribute in agent_monitoring.md in the same PR. ## Quick Start Ask the AI to add a new OpenTelemetry span attribute for a tool execution in the Copilot Chat extension following the otel skill conventions.

Frequently Asked Questions about otel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new OpenTelemetry span attribute in the Copilot Chat extension?▼

Add the attribute key as a constant in genAiAttributes.ts under GenAiAttr or CopilotChatAttr, never as a raw string literal. Use IOTelService.startActiveSpan, pass free-form values through truncateForOTel, and document the attribute in agent_monitoring.md with a unit test.

How does OpenTelemetry instrumentation differ between Copilot CLI and Claude Code agents?▼

The Copilot CLI runs in-process, so a bridge SpanProcessor forwards native SDK spans to IOTelService. Claude Code runs as a child process, so the extension synthesizes GenAI spans by intercepting the Claude SDK message stream in claudeMessageDispatch.ts.

Should new telemetry attributes use copilot_chat.* or github.copilot.* namespace?▼

New Copilot vendor attributes go under github.copilot.* only; copilot_chat.* is legacy and must not gain new keys. When renaming an existing legacy key, dual-emit both indefinitely because downstream readers depend on the old key.

Why are my custom spans not reaching the OTLP collector?▼

Spans whose gen_ai.operation.name is not in EXPORTABLE_OPERATION_NAMES in otelServiceImpl.ts are shown only in the debug panel and filtered from OTLP and SQLite exporters. Add the operation name to that list and document it in agent_monitoring.md.

When should prompt content capture be gated on captureContent config?▼

Gate large bodies like gen_ai.input.messages, gen_ai.output.messages, and system instructions on config.captureContent since they may contain secrets. Moderate debug-panel-essential data like tool arguments is always emitted but always truncated via truncateForOTel.