Skip to main content
GitHub Copilot sends OpenTelemetry data in two shapes:
  • The GitHub Copilot CLI, the Copilot app, and the VS Code Agent Host share one runtime and send traces and metrics with service.name=github-copilot. Settings and the sections after it apply to them. agentgolf harness setup copilot configures this shape only. The agentgolf CLI and its setup command run on Linux and macOS.
  • The local agent of the GitHub Copilot Chat extension in VS Code sends service.name=copilot-chat. Set it up by hand. See VS Code local agent.
A Self-Hosted Uplink instance records GitHub Copilot sessions from Uplink 0.1.43.

Settings

The Harness Setup card on Settings > Uplink > Publishing Keys shows these settings, and agentgolf harness setup copilot writes them. See Set up with the CLI. Copilot settings have no block for environment variables. So the setup has two parts:
  • Files in $COPILOT_HOME, or in ~/.copilot when COPILOT_HOME is unset. They hold the publishing key and the content setting. The command writes them.
  • Environment variables that turn on the export. The command prints them and writes no shell profile. Add them to the profile of the shell that starts Copilot. They hold no secret.
To copy the settings by hand, replace:
  • <endpoint> with https://uplink.agent.golf for Cloud Uplink, or with the listener of your Self-Hosted Uplink instance, for example http://127.0.0.1:4318.
  • <publishing-key> with your personal publishing key. See Publishing keys.
  • <copilot-home> with the absolute path of $COPILOT_HOME, for example /home/grace/.copilot.

1. The publishing-key file

Put the header in <copilot-home>/agentgolf-otlp-headers.json, and let only your user read the file (chmod 600):

2. The user settings

Add the telemetry keys to <copilot-home>/settings.json, and keep the file’s other settings:
  • headersProvider runs cat on the key file, and Copilot sends its output as the OTLP headers. Copilot reads this setting only from the user settings and the managed settings. A repository .github/copilot/settings.json cannot set it.
  • captureContent adds message and tool content. See Session content.
  • Copilot accepts comments and trailing commas in settings.json, but agentgolf harness setup copilot reads only strict JSON and refuses such a file. Remove the comments and trailing commas, or change a setting with copilot config: Copilot then writes the file again without them.

3. The environment variables

Export the variables in the shell that starts Copilot:
  • Set OTEL_EXPORTER_OTLP_PROTOCOL. Copilot uses http/json by default, and Uplink refuses JSON with 415.
  • Do not set grpc. The Copilot CLI has no gRPC exporter: it ignores grpc, sends http/json, and Uplink refuses it with 415. The process log then has the warning OTEL_EXPORTER_OTLP_PROTOCOL=grpc ignored.
  • github-copilot is the default Copilot service name. Set it anyway: a shell that exports OTEL_SERVICE_NAME for another tool changes the service name of Copilot. Then Agent Golf can record the session under the wrong harness.
  • A service.name in OTEL_RESOURCE_ATTRIBUTES wins over OTEL_SERVICE_NAME. Remove it from the environment of copilot, or unset OTEL_RESOURCE_ATTRIBUTES.
  • Start the Copilot app, or VS Code for Agent Host sessions, from a shell that has these variables. On macOS, VS Code that starts from the Dock does not read the shell environment.

Team rollout

An admin can roll out the export settings in the Copilot managed settings. Each developer then adds only their personal publishing key. See Roll out to a team. agentgolf harness managed-settings copilot prints the managed settings. Add --endpoint <url> for a Self-Hosted Uplink instance. See agentgolf harness managed-settings.
Install the document in one of these places:
  • Linux: /etc/github-copilot/managed-settings.json.
  • macOS: /Library/Application Support/GitHubCopilot/managed-settings.json.
  • Or the telemetry object of the server-managed managed-settings.json.
The file must be owned by root, must not be world-writable, and must not be a symbolic link. For example, on Linux:
Then each developer runs agentgolf harness setup --all, or agentgolf harness setup --all --endpoint <url> with the same URL for a Self-Hosted Uplink instance. It writes the publishing-key file and the user settings in <copilot-home>. Copilot uses the managed telemetry values in place of the environment variables, so the user needs no shell variables. The export lines that the command prints are then not necessary.
  • Never set headers or headersProvider in the managed settings, also not headersProvider: false. A managed headers or headersProvider wins over the user’s headersProvider, and a managed false turns off the user’s helper. Each of them hides the personal publishing key of each user.
  • When more than one managed source sets telemetry, the source with the highest precedence supplies the complete telemetry object. If your organization already has a managed telemetry object, merge these keys into it.

Session content

By default, Copilot sends no message content, tool arguments, or tool results. telemetry.captureContent adds them. The settings above turn it on. Remove it where your policy does not allow the uplink instance to receive that content. The environment variable OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT=SPAN_ONLY, and the older OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, also turn on content capture. To keep content off, make sure that the shell that starts Copilot does not set them. With content capture off, Agent Golf links fewer sessions to pull requests automatically. See Session content.

TLS with a private CA

If your Self-Hosted Uplink instance’s certificate comes from a private CA, point Copilot at the CA bundle:
NODE_EXTRA_CA_CERTS has no effect on the Copilot export.
Set OTEL_EXPORTER_OTLP_CERTIFICATE, or a client certificate variable, only with an https:// endpoint. With an http:// endpoint, Copilot turns off the export and shows no error. It writes a warning only in its process log.

Known limits

  • copilot --acp sends no OpenTelemetry data. Sessions in this mode do not show in Agent Golf.
  • A session that ends before its first model request sends no data.
  • With an http:// endpoint, Copilot writes Dynamic OpenTelemetry headers will be transmitted over cleartext HTTP in its process log, because the publishing key crosses the network in plain text. The export continues. For a Self-Hosted Uplink instance on loopback, you can ignore this warning.

Verify the setup

  • Start copilot and send a prompt. Then do the checks in Verify the setup.
  • If Uplink receives no requests, read the newest process log in <copilot-home>/logs. It has the line OpenTelemetry enabled: exporter=otlp-http when the export is on. The warning OTel policy build failed closed means that a TLS variable is set with an http:// endpoint.
  • If Uplink refuses the requests with 415, set OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf.
  • If Uplink receives requests but no session shows, confirm that OTEL_SERVICE_NAME is github-copilot in the environment of Copilot, and that OTEL_RESOURCE_ATTRIBUTES holds no service.name.

VS Code local agent

The GitHub Copilot Chat extension (GitHub.copilot-chat) runs the local agent of VS Code. It exports traces, metrics, and logs with service.name=copilot-chat. The facts in this section come from extension version 0.44.2. A chat session that uses the Agent Host (VS Code setting chat.defaultToCopilotHarness) sends the CLI shape (github-copilot) instead. A Copilot CLI session that you start in the VS Code terminal also sends the CLI shape. For those sessions, use the CLI Settings.

VS Code settings

agentgolf harness setup copilot does not configure VS Code. Replace:
  • <endpoint> with https://uplink.agent.golf for Cloud Uplink, or with the gRPC listener of your Self-Hosted Uplink instance, for example http://127.0.0.1:4317. A Self-Hosted Uplink instance opens the gRPC listener only when OTLP_GRPC_PORT is set. See Network.
  • <publishing-key> with your personal publishing key. See Publishing keys.
Add these keys to the VS Code user settings.json:
The extension has no setting for headers. It reads the publishing key only from OTEL_EXPORTER_OTLP_HEADERS in the environment of the VS Code process. Start VS Code with code from a shell that has the variable:
  • On macOS, VS Code that starts from the Dock does not read the shell environment, so it sends no key.
  • Reload the VS Code window after you change these settings.
  • Keep the default service name copilot-chat. Do not set OTEL_SERVICE_NAME in the shell that starts code.
  • Do not set OTEL_EXPORTER_OTLP_COMPRESSION. The extension sends uncompressed requests by default, and Uplink refuses a compressed request with gRPC status 12 (UNIMPLEMENTED).
The otlp-http exporter of the extension sends OTLP as JSON, and Uplink refuses JSON with 415. Use otlp-grpc. An uplink instance before Uplink 0.1.43 has no gRPC listener and cannot receive the VS Code export. Upgrade the uplink instance, or put an OpenTelemetry Collector between VS Code and the uplink instance: point otlpEndpoint at the collector, and let the collector send http/protobuf to the uplink instance. See A collector between the harness and Uplink.

VS Code session content

VS Code sends the prompts, the responses, the tool arguments, and the tool results for every value of captureContent. captureContent: false does not stop VS Code from sending prompt and tool content. The setting adds only the content of the inference log record and of the chat spans of BYOK models. No record shows the value of the setting. Agent Golf keeps this content like other session content. See Session content. The extension cuts each content value at 64,000 characters.

VS Code agents and tools

The local agent uses these tools: create_file, replace_string_in_file, multi_replace_string_in_file, insert_edit_into_file, edit_notebook_file, apply_patch, read_file, grep_search, and run_in_terminal. The Claude agent of the extension sends its tool calls under copilot-chat too, with the Claude Code tool names: Edit, MultiEdit, Write, NotebookEdit, Read, Grep, Glob, and Bash. Agent Golf records them as GitHub Copilot tool calls. The Claude agent starts Claude Code with the environment of VS Code. When that environment turns on Claude Code telemetry, Claude Code also sends its own records, and Agent Golf records them as a Claude Code session. See Claude Code.