- 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 copilotconfigures this shape only. TheagentgolfCLI 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.
Settings
The Harness Setup card on Settings > Uplink > Publishing Keys shows these settings, andagentgolf 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~/.copilotwhenCOPILOT_HOMEis 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.
<endpoint>withhttps://uplink.agent.golffor Cloud Uplink, or with the listener of your Self-Hosted Uplink instance, for examplehttp://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 thetelemetry keys to <copilot-home>/settings.json, and keep the file’s other settings:
headersProviderrunscaton 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.jsoncannot set it.captureContentadds message and tool content. See Session content.- Copilot accepts comments and trailing commas in
settings.json, butagentgolf harness setup copilotreads only strict JSON and refuses such a file. Remove the comments and trailing commas, or change a setting withcopilot 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 useshttp/jsonby default, and Uplink refuses JSON with415. - Do not set
grpc. The Copilot CLI has no gRPC exporter: it ignoresgrpc, sendshttp/json, and Uplink refuses it with415. The process log then has the warningOTEL_EXPORTER_OTLP_PROTOCOL=grpc ignored. github-copilotis the default Copilot service name. Set it anyway: a shell that exportsOTEL_SERVICE_NAMEfor another tool changes the service name of Copilot. Then Agent Golf can record the session under the wrong harness.- A
service.nameinOTEL_RESOURCE_ATTRIBUTESwins overOTEL_SERVICE_NAME. Remove it from the environment ofcopilot, or unsetOTEL_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.
- Linux:
/etc/github-copilot/managed-settings.json. - macOS:
/Library/Application Support/GitHubCopilot/managed-settings.json. - Or the
telemetryobject of the server-managedmanaged-settings.json.
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
headersorheadersProviderin the managed settings, also notheadersProvider: false. A managedheadersorheadersProviderwins over the user’sheadersProvider, and a managedfalseturns 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 completetelemetryobject. If your organization already has a managedtelemetryobject, 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.
Known limits
copilot --acpsends 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 writesDynamic OpenTelemetry headers will be transmitted over cleartext HTTPin 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
copilotand 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 lineOpenTelemetry enabled: exporter=otlp-httpwhen the export is on. The warningOTel policy build failed closedmeans that a TLS variable is set with anhttp://endpoint. - If Uplink refuses the requests with
415, setOTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf. - If Uplink receives requests but no session shows, confirm that
OTEL_SERVICE_NAMEisgithub-copilotin the environment of Copilot, and thatOTEL_RESOURCE_ATTRIBUTESholds noservice.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>withhttps://uplink.agent.golffor Cloud Uplink, or with the gRPC listener of your Self-Hosted Uplink instance, for examplehttp://127.0.0.1:4317. A Self-Hosted Uplink instance opens the gRPC listener only whenOTLP_GRPC_PORTis set. See Network.<publishing-key>with your personal publishing key. See Publishing keys.
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 setOTEL_SERVICE_NAMEin the shell that startscode. - Do not set
OTEL_EXPORTER_OTLP_COMPRESSION. The extension sends uncompressed requests by default, and Uplink refuses a compressed request with gRPC status12(UNIMPLEMENTED).
VS Code session content
VS Code sends the prompts, the responses, the tool arguments, and the tool results for every value ofcaptureContent. 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.