otel

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

1|Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Niiihuel/openide --skill otel-niiihuel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: otel
Source: https://github.com/Niiihuel/openide/tree/main/vscode/.github/skills/otel
Command: npx skills add https://github.com/Niiihuel/openide --skill otel-niiihuel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding or changing OpenTelemetry telemetry in the Copilot Chat extension requires navigating four different agent execution paths, strict attribute naming conventions, and documentation that must stay in sync with code. This Skill encodes those rules so instrumentation changes are consistent, exportable, and documented. ## Core Features & Use Cases - Span, metric, and event conventions: Enforces GenAI semantic conventions via constants in genAiAttributes.ts, the IOTelService abstraction, and the dual-emit policy for legacy copilot_chat.* attributes. - Agent-specific instrumentation strategies: Covers direct spans for the foreground agent, the bridge SpanProcessor for the in-process Copilot CLI, env var forwarding for terminal CLI, and message-stream synthesis for Claude Code. - Doc synchronization checklists: Requires updating agent_monitoring.md and agent_monitoring_arch.md alongside any code change, plus EXPORTABLE_OPERATION_NAMES for new OTLP-exported operations. - Use Case: When adding a new execute_tool attribute, the Skill directs you to define the constant, truncate values with truncateForOTel, decide on captureContent gating, add tests, and document the attribute in the monitoring docs. ## Quick Start Use the otel skill to add a new span attribute for tool execution latency and update the monitoring docs accordingly.

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 in the Copilot Chat extension?▼

Add attribute keys as constants in genAiAttributes.ts, then use IOTelService.startActiveSpan with the appropriate GenAiOperationName. Pass free-form content through truncateForOTel, and add the operation name to EXPORTABLE_OPERATION_NAMES if it should reach OTLP exporters.

How is OpenTelemetry instrumentation different for Claude Code versus Copilot CLI?▼

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

Can I import the OpenTelemetry API directly in extension code?▼

No. Consumers must depend only on the IOTelService abstraction. Direct @opentelemetry/* imports are restricted to node/otelServiceImpl.ts, fileExporters.ts, and the CLI bridge processor type imports.

When should span attributes be gated on captureContent?▼

Gate large prompt, response, and system-instruction bodies (like gen_ai.input.messages) on config.captureContent. Moderate, debug-panel-essential data like tool arguments and hook input/output are always emitted but always truncated via truncateForOTel.

Why must legacy copilot_chat attributes keep being emitted?▼

Downstream readers such as the Agent Debug Log, Chronicle, SQLite span store, and OTLP collectors may depend on legacy keys. When renaming to github.copilot.* equivalents, dual-emit both keys indefinitely with no sunset date.

What documentation must be updated when changing OTel configuration?▼

Update the setting registration in package.json, resolveOTelConfig in otelConfig.ts, and both agent_monitoring.md and agent_monitoring_arch.md. For subprocess env vars, also update the derive*OTelEnv helpers and their tests.