Setup: Claude Code desktop app (OTel telemetry to Revenium)
Configure OpenTelemetry for Claude Code sessions in the Claude desktop app so their AI usage is metered in Revenium.
Claude Code sessions in the Claude desktop app's Code tab are metered in Revenium alongside your CLI usage. How you set them up depends on whether your organization manages Claude Code settings centrally.
If your organization uses managed settings
If your organization deploys Revenium's telemetry settings through the claude.ai admin console (server-managed settings), or as a managed settings file or MDM profile on each device, Local sessions in the Code tab pick them up. There is nothing to enter by hand in the desktop app.
The admin console's server-managed settings are available on Claude for Teams and Claude for Enterprise plans. Anthropic's desktop app documentation describes how they reach Local sessions:
Local sessions on this machine: a managed settings file deployed to disk applies. Managed settings pushed remotely through the admin console also reach these sessions on Anthropic’s API when the session authenticates with an eligible login or key, following the same settings precedence as the terminal CLI.
Admin-console delivery needs a direct connection to Anthropic's API and an eligible credential, such as a Team or Enterprise login. Sessions routed through Amazon Bedrock, Google Cloud, Microsoft Foundry, or a custom ANTHROPIC_BASE_URL skip it; use a managed settings file or a Claude apps gateway for those.
If you are not using managed settings
For an individual setup, enter the values below in the desktop app's local environment editor:
In the Claude desktop app, open the Code tab.
Open the environment dropdown in the prompt box, hover over Local, and click the gear icon.
In the Edit local environment dialog, paste the settings below into the Environment variables box (
.envformat, oneKEY=valueper line). The dialog stores these securely and passes them to Claude sessions.Fully quit and relaunch the app.
Anthropic's own desktop app quickstart covers the Code tab and choosing an environment if you are new to the app.
Settings to add
Use a Revenium metering key (rev_mk_*), not an Anthropic/OpenAI provider key — the Revenium key authenticates telemetry ingest.
Field meanings are identical to the CLI managed-settings page (endpoint = Revenium OTLP; header = your metering key; protocol http/json; logs exporter otlp is how Revenium receives per-call telemetry; metrics none because Revenium bills from log events only and answers the metrics endpoint with 410 Gone; logs export interval 5000 ms, a 5-second flush).
Keep local values out of the way
If your organization manages these settings, leave Revenium telemetry values out of the desktop app's local environment editor. Managed settings already supply them, and a second, hand-entered copy can drift out of date.
Telemetry variables exported in your shell profile are not picked up. Anthropic's desktop app documentation notes: "On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as ~/.zshrc or ~/.bashrc, to extract PATH and a fixed set of Claude Code variables, but other variables you export there are not picked up."
Keep the desktop app updated so its sessions follow the behavior described here.
Collection marker
When the settings come from your organization's managed settings, Desktop sessions carry the organization's managed collection marker (revenium.middleware.source), the same as CLI sessions.
Verify your configuration
Start a short Local session in the Code tab and send a prompt. After the next telemetry flush, the session should appear in Revenium under AI Assistants > Claude Code, and its individual calls under Logs. If nothing appears, check: the metering key is active, the OTLP endpoint matches your Revenium environment, for an individual setup the key and endpoint in the local environment editor are current, and the app was fully quit and relaunched after any change.
Cloud sessions
Cloud sessions started from the desktop app run on Anthropic's infrastructure, not on your machine. Anthropic's desktop app documentation states that cloud sessions "receive server-managed settings; device-deployed files don’t reach them, because they run on Anthropic-managed VMs." Revenium's settings reach them through the admin console; a managed settings file, MDM profile, or local environment editor values on your device do not apply to them.
Last updated
Was this helpful?