Setup
Find your tool below and follow that one section. Each takes about 5 minutes. You only need to configure the tools you actually use.
Everything here uses the shared collector endpoint:
https://otel-collector-505600134356.europe-central2.run.app
The configurations below keep content capture off, so your prompts and responses are never sent. Mostly call metadata (model, tokens, cost, tool/skill usage) is collected — with one exception: Claude Code also records tool inputs (bash commands, file paths, etc.). See Data Collected for the full breakdown.
Step 0 — Set your identity (do this once)
So your usage is attributed to you instead of showing up as unknown, set your Aliz email as
the OpenTelemetry end-user ID.
macOS / Linux (zsh or bash) — add to ~/.zshenv (zsh) or ~/.bashrc (bash):
export OTEL_RESOURCE_ATTRIBUTES="enduser.id=<you>@aliz.ai"
For zsh, prefer ~/.zshenv over ~/.zshrc: ~/.zshenv is sourced for every shell (including
the non-interactive shells that editors and IDEs spawn agents from), whereas ~/.zshrc is only
sourced for interactive shells — so a ~/.zshrc-only setup silently reports unknown for
IDE-launched agents.
Windows (PowerShell) — export is not PowerShell syntax. Add this to your $PROFILE
instead, and set it once at the user level so new processes inherit it:
$env:OTEL_RESOURCE_ATTRIBUTES = "enduser.id=<you>@aliz.ai"
[Environment]::SetEnvironmentVariable("OTEL_RESOURCE_ATTRIBUTES", "enduser.id=<you>@aliz.ai", "User")
Open a new terminal afterwards so the variable is picked up. Tools started from a terminal inherit it automatically.
Apps launched from the macOS Dock/Finder/Spotlight or the Windows Start menu (e.g. VS Code, the
Codex desktop app) are not started from your shell, so they never read ~/.zshenv,
~/.bashrc, or $PROFILE — their telemetry is attributed to unknown. Fixing this depends on
the OS:
- macOS: register the variable in your GUI login session with a LaunchAgent so GUI apps
inherit it. See the
repo's macOS GUI-launch guide,
or simply launch the app from a terminal where
OTEL_RESOURCE_ATTRIBUTESis set. For the Copilot desktop app, use the extended LaunchAgent below to configure telemetry as well as identity. - Windows: the user-level
SetEnvironmentVariablecommand above covers Start-menu launches after you restart the app. - Or set the identity directly in the tool's own config where it supports one.
Claude Code
Nothing to do for most people — Claude Code telemetry is configured centrally. Telemetry is
enabled for the whole org through server-managed settings in the Claude admin console: an
env block that turns telemetry on, points it at the shared collector, and sets the
content-capture controls. Prompts, assistant responses, raw API bodies, and tool content
(tool results/output) are all off. Tool details (OTEL_LOG_TOOL_DETAILS=1) are on,
which means tool inputs are captured — bash commands, file paths, search patterns, URLs, and
skill / MCP / workflow / subagent names, plus JSON-serialized tool arguments. See
Data Collected for the exact breakdown. Because it's server-managed, this
applies to your Claude Code sessions without you configuring anything.
The org-level env block (managed by the AI Platform group, shown here for reference) is:
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://otel-collector-505600134356.europe-central2.run.app",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_TRACES_EXPORTER": "otlp",
"OTEL_LOG_USER_PROMPTS": "0",
"OTEL_LOG_ASSISTANT_RESPONSES": "0",
"OTEL_LOG_RAW_API_BODIES": "0",
"OTEL_LOG_TOOL_CONTENT": "0",
"OTEL_LOG_TOOL_DETAILS": "1"
}
}
Claude Code on the web (claude.ai/code)
Cloud sessions run on Anthropic's infrastructure and don't read your local config, so there's one required user-level step: allow the cloud environment to reach the collector. Without this, telemetry export silently fails.
The Network access setting is easy to miss, so here is the exact path:
- Open claude.ai/code.
- In the row above the message box, click the cloud icon showing the current environment name (usually "Default").
- Hover the environment in the Cloud section and click the gear icon on the right (or Add cloud environment for a new one). This opens the Update cloud environment dialog.
- Set Network access to Custom — an Allowed domains field appears. Enter one domain
per line (
*.example.commatches all subdomains); add:otel-collector-505600134356.europe-central2.run.app - Tick Also include default list of common package managers to keep the trusted allowlist on top of your own.
- Click Save changes.
Cloud sessions can't read your local OTEL_RESOURCE_ATTRIBUTES, so Step 0 doesn't apply to
them. Attribution still works: Claude Code always reports the logged-in account's email
(user.email) on every metric and event, local or cloud. Cloud sessions are additionally tagged
with the ccr.session.id resource attribute; local sessions are not.
If your local Claude Code isn't reporting
If a machine somehow isn't covered by the server-managed settings, add the same env keys to
~/.claude/settings.json yourself and restart Claude Code. Do not set
OTEL_EXPORTER_OTLP_HEADERS.
OpenAI Codex
Add this [otel] block to ~/.codex/config.toml, then restart Codex:
[otel]
environment = "dev"
log_user_prompt = false
exporter = { otlp-http = { endpoint = "https://otel-collector-505600134356.europe-central2.run.app/v1/logs", protocol = "binary" } }
trace_exporter = { otlp-http = { endpoint = "https://otel-collector-505600134356.europe-central2.run.app/v1/traces", protocol = "binary" } }
metrics_exporter = { otlp-http = { endpoint = "https://otel-collector-505600134356.europe-central2.run.app/v1/metrics", protocol = "binary" } }
Notes:
log_user_prompt = falsekeeps prompts out of telemetry — leave it as-is.- Codex is the one tool that needs the signal-specific
/v1/logs,/v1/traces, and/v1/metricspaths. Keep them exactly as shown. - This applies whether you run Codex through the VS Code plugin or the standalone app.
GitHub Copilot (VS Code)
Add this to your VS Code settings.json, then restart VS Code:
{
"github.copilot.chat.otel.enabled": true,
"github.copilot.chat.otel.otlpEndpoint": "https://otel-collector-505600134356.europe-central2.run.app",
"github.copilot.chat.otel.exporterType": "otlp-http",
"github.copilot.chat.otel.captureContent": false
}
captureContent: falsekeeps prompts and responses out of telemetry.- We deliberately do not set
telemetry.telemetryLevel: "all". Copilot's OTLP export only needs the level to be anything other than"off", and"all"would additionally opt you into VS Code's usage/error/crash telemetry to Microsoft — which is separate from our collector and not covered by the privacy statement above. - Identity for Copilot in VS Code comes from the environment VS Code itself is launched with,
not from
terminal.integrated.env.*(that only affects processes you start inside the integrated terminal, not the Copilot extension host). If VS Code is launched from the Dock / Start menu, follow the desktop-app guidance in Step 0 soenduser.idis set; otherwise it staysunknown. - These settings only affect Copilot inside VS Code. For the macOS desktop app, follow the desktop setup below. Other clients, such as JetBrains, are configured separately.
GitHub Copilot CLI
Set these environment variables in the shell that starts copilot (add them to ~/.zshenv for a
persistent setup, then open a new terminal):
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel-collector-505600134356.europe-central2.run.app"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export COPILOT_OTEL_EXPORTER_TYPE="otlp-http"
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="false"
export OTEL_RESOURCE_ATTRIBUTES="enduser.id=<you>@aliz.ai"
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobufmatches what the Cloud Run collector expects; the CLI otherwise defaults tohttp/json, which the collector may reject.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=falsekeeps prompt and response content out of telemetry.
On Windows PowerShell, use $env:NAME = "value" for the current session and
[Environment]::SetEnvironmentVariable("NAME", "value", "User") to persist, instead of
export.
GitHub Copilot desktop app (macOS)
The desktop app (GitHub Copilot.app) embeds the Copilot CLI runtime and uses its telemetry
environment variables. Aliz verified this setup end to end with app version 1.0.25; that
runtime had no settings-file option for OTel routing. Newer releases have not been verified in
this guide. See the app changelog when
checking a newer version.
Dock/Finder launches don't inherit shell-profile exports. Use a LaunchAgent to set the variables in your GUI login session and reapply them at each login:
-
Create
~/Library/LaunchAgentsif needed (mkdir -p ~/Library/LaunchAgents). Save the following as~/Library/LaunchAgents/ai.aliz.otel-env.plist, replacingfirst.last@aliz.aiwith your Aliz email. If you already installed the identity-only LaunchAgent from Step 0, replace it with this version and preserve any additional attributes inOTEL_RESOURCE_ATTRIBUTES.<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>Label</key><string>ai.aliz.otel-env</string><key>ProgramArguments</key><array><string>/bin/sh</string><string>-c</string><string>launchctl setenv OTEL_RESOURCE_ATTRIBUTES "enduser.id=first.last@aliz.ai"launchctl setenv COPILOT_OTEL_ENABLED "true"launchctl setenv COPILOT_OTEL_EXPORTER_TYPE "otlp-http"launchctl setenv OTEL_EXPORTER_OTLP_ENDPOINT "https://otel-collector-505600134356.europe-central2.run.app"launchctl setenv OTEL_EXPORTER_OTLP_PROTOCOL "http/protobuf"launchctl setenv OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT "false"</string></array><key>RunAtLoad</key><true/></dict></plist> -
Reload the LaunchAgent from Terminal in your GUI login session:
launchctl bootout gui/$(id -u)/ai.aliz.otel-env 2>/dev/nulllaunchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.aliz.otel-env.plistlaunchctl getenv OTEL_RESOURCE_ATTRIBUTESlaunchctl getenv COPILOT_OTEL_ENABLEDlaunchctl getenv OTEL_EXPORTER_OTLP_ENDPOINTThe checks should show your
enduser.id,true, and the shared collector URL. On first installation,bootoutmay find no existing agent; continue withbootstrap. -
Quit and reopen Copilot, make a fresh call, and check that it appears under your identity in the AI Telemetry dashboard. Running apps don't pick up the new values.
Content capture stays off via OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false.
Keep COPILOT_OTEL_EXPORTER_TYPE=otlp-http as shown: it is the selector used by the tested CLI
runtime. The VS Code extension's COPILOT_OTEL_PROTOCOL setting uses different names and values.
All GUI apps launched afterwards inherit these variables. Setting OTEL_EXPORTER_OTLP_ENDPOINT
can enable or reroute telemetry in other apps that read it. Keep Claude Code's exporter settings
consistent with the shared endpoint and verify routing after restarting it. Codex configures its
endpoint separately in ~/.codex/config.toml.
Remove the desktop setup
Unloading the LaunchAgent does not clear variables it already set. To remove this setup, run:
launchctl bootout gui/$(id -u)/ai.aliz.otel-env
rm ~/Library/LaunchAgents/ai.aliz.otel-env.plist
launchctl unsetenv OTEL_RESOURCE_ATTRIBUTES
launchctl unsetenv COPILOT_OTEL_ENABLED
launchctl unsetenv COPILOT_OTEL_EXPORTER_TYPE
launchctl unsetenv OTEL_EXPORTER_OTLP_ENDPOINT
launchctl unsetenv OTEL_EXPORTER_OTLP_PROTOCOL
launchctl unsetenv OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT
Quit and reopen affected apps. To retain identity attribution for other GUI tools, reinstall the identity-only LaunchAgent linked in Step 0 after clearing these variables.
For the original verification details, see the repo's desktop setup guide.
Troubleshooting
- Usage shows as
unknown—OTEL_RESOURCE_ATTRIBUTES=enduser.id=...isn't set in the environment the tool runs in. Re-check Step 0 and, for desktop apps, set the identity in the GUI login session or the tool config where supported. - No data appears at all — your machine or network must be able to reach the collector URL.
The collector expects OTLP/HTTP (
http/protobuf); OTLP/gRPC against Cloud Run will not work. - Changed the config but nothing changed — restart the tool (Codex, VS Code) or open a new terminal (CLIs) so it re-reads settings.
If your network blocks the public collector endpoint, there's a backup local Docker relay in the
ai-telemetry repo.
Most people don't need it.
Trust model & limitations
- Copilot desktop and CLI usage share a dashboard label. In the runtime tested with app
version 1.0.25, the dashboard labels both
copilot-cli. Treat this as combined desktop/CLI usage; newer runtimes have not been rechecked. See the reporting limitation. - The collector is a public, unauthenticated endpoint. The default setup sends OTLP with no
auth header (this is why the guides say not to set
OTEL_EXPORTER_OTLP_HEADERS). Anyone who can reach the URL can post data to it. enduser.idis self-declared and not verified. Attribution is trust-based: the value comes from each client'sOTEL_RESOURCE_ATTRIBUTESand is not authenticated server-side. Treat the usage data as good-faith engineering metrics, not as a tamper-proof audit trail.- Authenticated ingestion and server-side identity validation are possible future hardening
steps owned by the AI Platform group; see the
ai-telemetryarchitecture notes.