OpenTelemetry · GitHub Copilot

You can't tune
what you can't see.

Turn GitHub Copilot's OpenTelemetry into one Grafana dashboard — prompt‑cache hit rate, tokens, latency and tools — across VS Code and the CLI. Runs on your laptop for $0; scales to a fleet.

prompt cache · cache_read vs cache_creation 63%hit rate
cache_read (hit) cache_creation (miss)
VS Codeservice.name=copilot-chat Copilot CLIservice.name=github-copilot

The idea

Two surfaces, one vocabulary — so one dashboard.

VS Code Copilot Chat and the Copilot CLI both emit the OpenTelemetry GenAI conventions. The attributes are identical; they differ in exactly one thing — service.name. Turn that into a dropdown and two data streams become one board.

VS Code Copilot Chat
resource.service.name = copilot-chat

Enable with four github.copilot.chat.otel.* user settings, or the same env vars.

GitHub Copilot CLI
resource.service.name = github-copilot

Enable with OTEL_* env vars. Same telemetry engine, shared with the Copilot SDK.

Copilot surface selector → All (VS Code + CLI) · VS Code · Copilot CLI. Keep OTEL_SERVICE_NAME unset so each surface keeps its own name.
The honest map

Which Copilot surfaces emit OpenTelemetry?

Not all of them — yet. This project covers the two you can actually collect from today, plus the SDK for apps you build. No overclaiming.

VS Code Copilot Chatsettings or OTEL_* env
GitHub Copilot CLIOTEL_* env vars
Copilot SDK — for apps you buildTelemetryConfig
Visual Studio extensionnot today
JetBrains pluginsRider's OTel plugin ≠ Copilot
?Copilot app (desktop)not documented
Cloud coding agent (opens PRs)server-side; client counters only

What you can monitor

Traces, metrics, and events — the questions they answer.

Every interaction is a span tree: invoke_agent → chat → execute_tool. All of it follows the GenAI conventions, so the same queries work on both surfaces.

cache

Prompt‑cache efficiency

Hit vs miss over time, per model, per surface.

gen_ai.usage.cache_read
gen_ai.usage.cache_creation
cost

Tokens & cost

Input/output/cached tokens, cost and AI units per turn.

gen_ai.usage.*_tokens
github.copilot.cost · aiu
latency

Speed

Duration and time‑to‑first‑token, sliced by model.

gen_ai.client.operation.duration
time_to_first_token
tools

Tool usage & reliability

Which tools run, how often, how slow, how often they fail.

execute_tool · gen_ai.tool.name
outcomes

Adoption & impact

Edits accepted, lines shipped, edit survival, thumbs, PRs.

edit.acceptance · lines_of_code
edit.survival · pull_request
reliability

Errors & sessions

Error types, stuck/aborted sessions, context compaction.

error.type · session.abort
See it

One board. Flip the selector.

Cache hit/miss, calls by surface, models, tools, and a raw trace table — filtered to VS Code, the CLI, or both.

localhost:3001 · GitHub Copilot OTel — VS Code + CLI
Grafana dashboard showing both Copilot surfaces: total LLM calls, cache read vs creation tokens, calls by surface (copilot-chat and github-copilot), calls by model, top tools, and a trace table.

The All (VS Code + CLI) view, running on local Grafana + Tempo.


Where the telemetry lands

From a laptop to a fleet — four backends.

Same surfaces, same dashboard. Start local and offline; grow into your Azure tenant or Grafana Cloud. None of them needs a paid Grafana instance.

A

Local

Docker: Grafana Tempo + Grafana. Offline, private.

$0
B

Azure · local collector

Collector fans out to Tempo and Application Insights.

~$0
C

Azure Container Apps

Cloud collector, scale‑to‑zero. Nothing runs locally.

~$0 idle
D

Grafana Cloud

Point straight at managed Tempo. Nothing to run.

free tier
Your prompts stay yours

Private by default.

The question that decides whether you can roll this out — answered plainly.

Telemetry goes to your endpoint, not GitHub. Enabling OTLP export routes data to the collector or backend you configure. It doesn't send anything extra to GitHub or Microsoft.

No prompts, code, or responses by default. Content capture is off — the GenAI conventions' deliberate opt‑in. You get metadata: model, token counts, durations, tool names, cache hits/misses.

Know the two identifying bits. VS Code attaches repo URL / branch / commit / org; the CLI attaches a pseudonymous user id. MCP server names are SHA‑256 hashed.

The collector is your redaction control point. On the collector backends you can delete or hash attributes (e.g. drop github.copilot.git.*) before anything leaves.

You choose where data lives. On your laptop, in your Azure region (pick an EEA region for residency), or Grafana Cloud's SaaS. Content capture, if you ever turn it on, only against a backend you own.


Start in five minutes

Clone, compose, chat.

The local path (Option A) needs no cloud account and costs nothing.

1

Bring up the stack

Grafana Tempo receives OTLP; Grafana serves the dashboard on port 3001.

# clone, then
docker compose up -d
2

Point Copilot at it

Four keys in your VS Code User settings — and the CLI reads the same via env vars.

{
  "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
}
3

Use Copilot, then watch

Ask Copilot Chat a few questions or run copilot, then open the board and flip the surface selector.

# open
http://localhost:3001  # → GitHub Copilot OTel — VS Code + CLI