OpenObserve Docs
IntegrationAI

GitHub Copilot → OpenObserve

Updated View MarkdownOpen in ChatGPTOpen in Claude

Monitor GitHub Copilot agent sessions in OpenObserve using OpenTelemetry.

Both the Copilot Chat extension in VS Code and the Copilot CLI ship with a native OpenTelemetry exporter. Point it at OpenObserve's OTLP endpoint and every agent interaction — model calls, tool executions, token usage — streams in directly. No collector, no SDK, no custom code.

What you get

SignalExamplesStored in OpenObserve as
Tracesspan tree per agent turn: invoke_agent → chat, execute_tool, execute_hook, following the OTel GenAI semantic conventionsA traces stream
Metricstoken-usage histograms, operation durations, tool call counts, edit acceptanceMetric streams
Eventsinference details, session starts, tool invocations, agent turnsA log stream

Prerequisites

  • GitHub Copilot with an active subscription — the Copilot CLI (npm install -g @github/copilot) and/or VS Code with the Copilot Chat extension
  • An OpenObserve account (cloud or self-hosted)
  • Your OpenObserve organisation ID and Base64-encoded auth token

Setup

1. Get your OpenObserve endpoint and auth token

OpenObserve accepts OTLP over HTTP at https://<your-openobserve-host>/api/<your-org>. The exporter appends /v1/traces, /v1/metrics, and /v1/logs itself, so configure the base endpoint with no trailing slash.

Generate the Authorization value (Basic <base64(email:password)>):

echo -n 'your-email:your-password' | base64

2. Configure GitHub Copilot

Export the OTLP environment variables before starting copilot (add to your shell profile to persist):

export COPILOT_OTEL_ENABLED=true
export COPILOT_OTEL_EXPORTER_TYPE=otlp-http
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT="https://<your-openobserve-host>/api/<your-org>"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <base64-token>"
export OTEL_SERVICE_NAME=github-copilot

Set COPILOT_OTEL_EXPORTER_TYPE=otlp-http: without it the CLI writes telemetry to a local file exporter instead of sending OTLP.

Add to VS Code settings.json:

{
  "github.copilot.chat.otel.enabled": true,
  "github.copilot.chat.otel.exporterType": "otlp-http",
  "github.copilot.chat.otel.otlpEndpoint": "https://<your-openobserve-host>/api/<your-org>"
}

The auth header cannot be set in settings.json — it comes from the environment, so launch VS Code with the variable set:

export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <base64-token>"
code .

Environment variables

VariableDescriptionDefault
COPILOT_OTEL_ENABLEDEnable OTel exportfalse
COPILOT_OTEL_EXPORTER_TYPEExporter backend — set to otlp-http (CLI defaults to a local file exporter)file
OTEL_EXPORTER_OTLP_ENDPOINTOpenObserve base endpoint, no trailing slash—
OTEL_EXPORTER_OTLP_HEADERSAuth headers (Authorization=Basic <base64-token>)—
OTEL_EXPORTER_OTLP_PROTOCOLSet to http/protobuf — required for OpenObservehttp/json
OTEL_SERVICE_NAMEService name on all telemetrycopilot-chat
OTEL_RESOURCE_ATTRIBUTESExtra resource attributes (key1=val1,key2=val2)—
COPILOT_OTEL_CAPTURE_CONTENTCapture full prompt/response textfalse
COPILOT_OTEL_LOG_LEVELMinimum event level (trace…error)info

OTLP over HTTP only for the CLI

The Copilot CLI exports over OTLP HTTP only — if grpc is configured it silently falls back to HTTP. Use the HTTP endpoint form shown above.

Prompt capture is off by default

COPILOT_OTEL_CAPTURE_CONTENT=true includes full prompt and response text in the telemetry. Leave it off unless you have a deliberate reason, and make sure OpenObserve retention and access controls match your data-handling policy.

3. Verify

  1. Run a Copilot session — e.g. copilot in a terminal, ask it something — or use Copilot Chat in VS Code.
  2. In OpenObserve, open Traces and filter by service_name = 'github-copilot' (or copilot-chat if you didn't set a service name). Each turn appears as an invoke_agent root span with a chat <model> child carrying gen_ai_provider_name, the model, and token usage.
  3. Open Metrics and look for the Copilot token-usage and duration streams.

GitHub Copilot trace in OpenObserve

What Gets Captured

AttributeDescription
gen_ai_operation_nameOperation per span (invoke_agent, chat, execute_tool)
gen_ai_provider_nameModel provider behind the request
gen_ai_request_model / gen_ai_response_modelModel used for the turn
gen_ai_usage_input_tokens / gen_ai_usage_output_tokensToken usage per model call
gen_ai_tool_nameTool invoked in execute_tool spans
github_copilot_agent_typeCopilot agent surface (CLI, chat)
github_copilot_git_repositoryRepository the session ran in
span_statusOK on success, ERROR on failure
durationLatency of each agent step

With COPILOT_OTEL_CAPTURE_CONTENT=true, prompt and response text are added to the inference spans.

Org-wide rollout

GitHub Enterprise administrators can mandate the OTel destination centrally via the telemetry block in enterprise-managed settings, so telemetry from every developer's VS Code and Copilot CLI flows to OpenObserve without per-user environment variables.

Troubleshooting

The CLI logs its OTel state to ~/.copilot/logs/ — set COPILOT_OTEL_LOG_LEVEL=debug for detail. On startup you should see OpenTelemetry enabled: exporter=otlp-http.

SymptomCauseFix
No data at allExporter not enabledSet COPILOT_OTEL_ENABLED=true and restart the session
Log shows exporter=fileDefault exporter is a local fileSet COPILOT_OTEL_EXPORTER_TYPE=otlp-http
404 on exportTrailing slash on the endpointUse .../api/<org> with no trailing /
401/403 errorsWrong auth headerRe-encode email:password; header is Authorization=Basic <base64>
Traces but no contentContent capture disabled (default)Set COPILOT_OTEL_CAPTURE_CONTENT=true if you need it
VS Code sends nothingEnv var not visible to the appLaunch VS Code from a shell that has OTEL_EXPORTER_OTLP_HEADERS exported

Read More

Was this page helpful?

On this page