Learning resourcesReviewed · GitHub

OpenTelemetry instrumentation for Copilot SDK

This GitHub guide helps Copilot SDK developers add OpenTelemetry tracing, but it does not provide complete installation or tracing backend setup. It covers CLI telemetry, output configuration and connecting application spans with CLI spans.

Researched 15 Nov 2026

In short.

This GitHub guide teaches Copilot SDK developers to collect and connect execution traces, but advanced integration varies by language and some telemetry attributes are still evolving. It documents opt-in CLI telemetry, OTLP over HTTP, JSON-lines trace output and W3C trace-context propagation over JSON-RPC. It also explains which skill and process details are recorded and which require content capture. Nothing was executed; compatible versions, operational overhead, costs and licence terms are not established.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/observability/opentelemetry], including configuration examples, language dependencies, skill and process attribution rules, content-capture conditions, propagation details, breaking-name notices and stability notices. Linked pages, repositories and specifications are excluded. No code was executed; runtime correctness, compatibility, performance, costs and deployment behavior remain unassessed.

The overview

Identity

OpenTelemetry instrumentation for Copilot SDK is a GitHub documentation guide for adding observability to applications using Copilot SDK. Its address is [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/observability/opentelemetry].

The resource is instructional documentation. It explains how the SDK configures telemetry in the Copilot CLI process and connects that process with application tracing.

Assessment

The guide is useful when an application needs visibility into Copilot CLI operations or needs its own request and tool-handler spans connected to CLI spans. A span records one operation; a distributed trace links related operations across application boundaries.

Its strongest material is the distinction between basic telemetry configuration and advanced trace-context integration. It provides implementation details and attribution caveats, but no runtime validation, performance measurements or complete deployment walkthrough.

Users

The intended readers are developers already building with Copilot SDK. Client configuration examples cover TypeScript, Python, Go, .NET, Java and Rust.

Developers who only need CLI traces can start with TelemetryConfig. Those already creating OpenTelemetry spans can use the advanced material to connect application requests and custom tool handlers with CLI operations. Beginners will need additional guidance for SDK installation and tracing infrastructure.

Capabilities

TelemetryConfig exposes an OTLP HTTP endpoint, protocol selection, a JSON-lines trace file path, exporter type, instrumentation scope name and message-content capture. Exporter choices are otlp-http and file. The protocol option accepts http/json or http/protobuf and applies to all signals from the CLI's OTLP HTTP exporter.

Skill instrumentation refines existing execute_tool spans rather than adding a separate skill operation. Skill and resource names are available independently of content capture; descriptions, source URIs and executable paths require capture. Process telemetry can identify the directly launched executable and an integer exit code when reported.

Using it

Requirements

The examples require a Copilot SDK application. OTLP export also needs a receiving endpoint; file export is another documented option. The page does not specify minimum SDK or CLI versions, authentication prerequisites or collector installation.

The page's per-language dependency table lists: Python, opentelemetry-api, installed with pip install copilot-sdk[telemetry]; Go, go.opentelemetry.io/otel, marked as a required dependency; .NET, the built-in System.Diagnostics.Activity; and Java, io.opentelemetry:opentelemetry-api, added for SDK-based setup, with automatic trace-context injection when the OpenTelemetry Java agent or SDK is configured. The page does not say whether these are needed for basic TelemetryConfig export alone. Node.js has no SDK OpenTelemetry dependency, but the custom-span examples import @opentelemetry/api. Rust telemetry configuration is shown without corresponding dependency or propagation instructions.

Mechanism

The SDK configures telemetry on the CLI process and can carry W3C traceparent and tracestate values in JSON-RPC payloads. These values connect application and CLI spans within one distributed trace.

For outbound Node.js calls, onGetTraceContext supplies the active context before session.create, session.resume and session.send. Python, Go and .NET inject context automatically when their tracing APIs are configured; the Java dependency note also describes automatic injection with a configured OpenTelemetry agent or SDK.

For incoming tool calls, Go provides a restored context through ToolInvocation.TraceContext. Python and .NET restore context around handlers. Node.js exposes raw traceparent and tracestate strings that the application must restore manually. Java and Rust inbound handling are not explained separately.

Setup

The basic examples create a client with a telemetry endpoint of [http://localhost:4318]. Option names differ by language: for example, TypeScript uses otlpEndpoint and Python uses otlp_endpoint. This configuration opts into CLI telemetry without requiring custom application spans.

Choose the exporter type (otlp-http or file) and its destination, either an OTLP HTTP endpoint or a file path. For otlp-http, you can optionally set the protocol to http/json or http/protobuf to match the receiving endpoint. Leaving the protocol unset uses the CLI default, whose value is not stated. Applications needing a shared trace must also configure their language's tracing API and the applicable context propagation hooks. Collector configuration, exporter authentication and file permissions are not covered.

Example

The Node.js example defines a custom tool named my-tool. Its handler reads traceparent and tracestate from the invocation, extracts the parent context and starts an application span inside that context. A finally block ends the span, and client.createSession registers the tool.

The intended result is an application tool-handler span beneath the CLI's tool-execution span. This illustrates the context relationship; the example was not executed and establishes no measured result.

Assessment & evidence

Limitations

Telemetry attribution has explicit boundaries. Poll tools do not inherit process attributes from the commands they read. Executable identities can be absent when a sandbox does not expose them, and unavailable exits or failures before process launch omit exit codes. A nonzero command exit does not itself mean the tool failed.

Custom tools overriding built-in names do not inherit native skill or process attributes. Preloaded skills produce invocation events without fabricated tool spans. Script attribution uses the command after hooks run and can be omitted when startup scripts or profiles make its execution context uncertain.

Content capture is a material data choice: skill and resource names remain available without it. While managed telemetry settings are unresolved, buffering retains only capture-independent tool facts; enabling capture later does not recover earlier descriptions, source URIs or executable paths. Disabled or cancelled tracking discards the buffer. Sampling, overhead, reliability and production behavior are not assessed.

Practical value

The documented distinction between exporting CLI traces and propagating application context is useful: applications can collect CLI activity without implementing custom span linking. Additional integration is needed when developers want to follow one operation through their own code and the CLI.

The attribution rules also help readers interpret missing fields without assuming that every omission is an instrumentation failure. These are expected benefits of the documented design; the page provides no measurements of debugging effectiveness or operational savings.

Alternatives

Within this guide, the simpler route is TelemetryConfig alone for CLI traces. The more involved route adds application spans and context propagation to produce a shared distributed trace.

Output choices include an OTLP HTTP endpoint and JSON-lines file output, with http/json or http/protobuf available for OTLP. The page does not compare tracing vendors, other SDKs or competing guides, so their relative suitability is unknown.

Evidence

The evidence is the complete GitHub documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/observability/opentelemetry]. It supplies configuration snippets, option and dependency tables, propagation examples and telemetry interpretation rules.

The page links to SDK documentation, event documentation and OpenTelemetry specifications, but those pages are not included here. Its examples support an explanation of intended behavior, not a claim that the SDK, CLI, collector or tools were run.

Access & freshness

Costs

The page provides no prices for Copilot access, model usage, telemetry collection, storage or backend services. Total operating cost is unknown.

For cost attribution, it points to assistant.usage events and the apiEndpoint field, which distinguishes Chat Completions, Responses and Anthropic Messages. Identifying the API route does not establish a price or actual spend; the linked event documentation is outside this page.

Rights

The page does not state a documentation licence, code-sample licence or redistribution permission. SDK licensing and applicable service terms are also not established by this page.

Telemetry ownership, retention terms and rights governing captured message content are unspecified.

Freshness

The available page copy was captured on 15 November 2026. The text gives no publication date, last-update date or compatible SDK and CLI version numbers.

The guide identifies breaking telemetry changes: gen_ai.skill.name replaces github.copilot.tool.parameters.skill_name and github.copilot.skill.name; gen_ai.skill.source.uri replaces github.copilot.skill.path. Local source values are file URIs. Skill attributes and span refinements have Development stability, while process attributes have Release Candidate stability, so dashboards and queries may need adjustment as conventions change.

Next steps

Decide whether CLI traces alone meet the need or whether application and CLI spans must share a trace. Then choose an output destination and confirm that the installed SDK and CLI support the documented options for the chosen language.

Decide which content may be recorded, confirm the receiving endpoint's protocol and obtain the missing backend setup instructions. Existing integrations should check queries against the renamed skill attributes. Before relying on the integration, validate trace relationships, recorded fields and operational overhead in the intended environment; these remain unassessed here.

Evidence for this report

selected-page.txtselected · checked 2026-11-15