opentelemetry for github copilot

Copilot,
Traced.

Your AI pair programmer is a distributed system. Measure it like one.

about your last copilot turn

Three questions most teams
cannot answer yet.

01

How many tokens?

The actual input, output, cache-read, and cache-creation counts.

02

What did it cost?

For that turn, from the span - not from a monthly aggregate.

03

Was the prefix cached?

Or did one volatile byte make the model process it again?

the reframe

Treat Copilot like the distributed system it is.

a service you own

Measured

Requests, dependencies, retries, latency, errors, cache hit rate, and cost per operation.

trace → dashboard → decision
your coding agent

Usually judged by feel

A planner calls models and tools, crosses networks, retries, compacts context, uses a cache, and creates a bill.

"it felt slower today"
the useful surprise Copilot already emits OTLP traces and metrics using OpenTelemetry GenAI conventions.
the whole integration

Two switches. One OTLP endpoint.

VS Code - user settings.json
{
  "github.copilot.chat.otel.enabled": true,
  "github.copilot.chat.otel.exporterType": "otlp-http",
  "github.copilot.chat.otel.otlpEndpoint": "http://localhost:4318",
  "github.copilot.chat.otel.captureContent": false
}
Copilot CLI - environment
setx COPILOT_OTEL_ENABLED "true"
setx OTEL_EXPORTER_OTLP_ENDPOINT "http://localhost:4318"
setx OTEL_EXPORTER_OTLP_PROTOCOL "http/protobuf"

# Leave OTEL_SERVICE_NAME unset.
keep the defaults VS Code reports as copilot-chat; the CLI reports as github-copilot. Those names power the surface selector.
coverage as of 17 august 2026

Coverage is wider - but it is not universal.

documented

Strong paths

VS Code copilot-chat

Copilot CLI github-copilot

Copilot SDK configurable via TelemetryConfig

new or indirect

Verify the name

JetBrains now has an OTel export panel; its service name is not documented.

Copilot app uses the CLI runtime and has been observed as github-copilot.

not a direct trace path

Keep the claim narrow

Visual Studio has no documented customer export path.

Cloud coding agent exposes client-side session/outcome metrics, not its server-side execution trace.

what comes off the wire

One turn is a trace you already know how to read.

invoke_agent

One user turn

Agent identity, aggregate tokens, cost, AI units, and turn count.

chat

Model call

Model, input/output tokens, cache creation, time to first chunk.

execute_tool

Dependency call

Tool name, duration, error, and optional content.

chat

Next model call

Same prefix, cache read, lower latency.

demo 1

Click a span. live

the mental model

A cache hit requires a stable prefix.

A stable prompt prefix is read from cache; changing a token near the front forces the remaining prefix to be created again.
pick one number to watch first

Cache hit rate is a leading indicator.

it reveals

Prompt stability

System instructions, tool order, and conversation history are staying stable between calls.

it predicts

Cost pressure

More cache creation means more input is processed as fresh instead of reused.

it predicts

Latency pressure

Cache reads often reach the first streamed chunk faster than equivalent cold calls.

the definitions cache_read.input_tokens > 0 = hit  ·  cache_creation.input_tokens > 0 = miss.
same wire, different destination

Pick the operating model you already trust.

GitHub Copilot OpenTelemetry can go to local Tempo, Azure through a local collector, an Azure Container Apps collector, or Grafana Cloud.
demo 2

Change the destination, not the signal. live

the result

One dashboard, split by runtime.

Grafana dashboard summary with the Copilot surface selector and large totals for model calls, cache reads, cache creation, and tool calls.
01Pick a runtime

All, VS Code, or Copilot CLI.

02Check cache health

Read versus creation tokens over time.

03Find the slow model

Calls, p50, and time to first chunk.

04Open the trace

Drill from a recent operation to raw spans.

demo 3

Make an invisible regression visible. live

current documentation, not folklore

Measure the system without collecting the conversation.

content capture off

Conversation stays out

Prompts, responses, system instructions, tool schemas, arguments, and results require explicit opt-in.

metadata still flows

Enough to operate

Model, token counts, cache counts, duration, cost/AI units, service, agent, and tool names.

govern this too

Identifiers remain

The CLI can emit a pseudonymous user ID; repo, branch, commit, organization, agent, and skill metadata can identify work.

collector rule Keep content capture off, then remove identifiers and work metadata you do not need before a shared backend.
the smallest useful path

Monday morning, in order.

1

See one machine

Start option A, enable VS Code and the CLI, use Copilot normally, and open the local dashboard.

2

Find the expensive misses

Sort by cache-creation tokens. Correlate spikes with truncation and compaction events.

3

Choose where the data should live

Keep it local, keep it in your Azure tenant, or use Grafana Cloud - with a collector when you need minimization and fan-out.

the goal Replace "Copilot feels slow" with a trace, a cache hit rate, and a next action.
one thing to take home

The tool writing your code
should not be the one system
you never measure.

Tokens, latency, tools, cost, and every cache miss are already on the wire. Point them somewhere useful.

resources and q&a

Take it with you.

the working repository

github.com/webmaxru/
copilot-opentelemetry

Four backend options, collector configs, dashboards, Azure scripts, and the source for this deck.

copilot-opentelemetry.isainative.dev
official references checked 17 aug 2026
Copilot CLI OTel monitoringGitHub Docs
Monitor agent usageVS Code Docs
Copilot SDK instrumentationGitHub Docs
JetBrains OTel exportGitHub Changelog