Monitoring changedmonitoring-usage
Upstream edited this page at 10 Oct 2026 18:17 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 10 Oct 2026 18:37 UTC.
Upstream edited
Recorded here
Lines+33added
Lines−3removed
From line
436
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits60to this page, all time
### Attribute telemetry to Desktop SSH sessions
The whole hunk
from line 436, old and new numbered
/
from line 436
436436 Wrapping values in quotes doesn't escape spaces. For example, `org.name="My Company"` results in the literal value `"My Company"` with the quotes included, not `My Company`.
437437</Warning>
438438
439### Attribute telemetry to Desktop SSH sessions
440
441To see which remote machine a [Desktop SSH session](/docs/en/desktop#ssh-sessions) ran on, name each machine in a custom attribute. Metrics and events don't name the machine a session ran on.
442
443On each remote machine, add [`OTEL_RESOURCE_ATTRIBUTES`](#multi-team-organization-support) to the `env` block that turns telemetry on, in the [managed settings file the session reads](/docs/en/desktop#managed-settings). Write the name out in each machine's file. Claude Code doesn't expand the value, so `host.name=$(hostname)` arrives as those characters.
444
445The following example names the machine `build-7`:
446
447```json theme={null}
448{
449 "env": {
450 "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
451 "OTEL_METRICS_EXPORTER": "otlp",
452 "OTEL_LOGS_EXPORTER": "otlp",
453 "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
454 "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317",
455 "OTEL_RESOURCE_ATTRIBUTES": "host.name=build-7"
456 }
457}
458```
459
460When nothing else sets the variable, `host.name` arrives in the resource block, in Desktop SSH sessions and in the CLI on that machine. For where else custom attributes appear, see [Multi-team organization support](#multi-team-organization-support).
461
462If the name doesn't arrive, check for one of these causes:
463
464* **You set it on the computer that runs Desktop**: Desktop doesn't pass a value you set there to the SSH session
465* **You exported it in a login file**: only login shells read a file such as `/etc/profile`. A value you `export` there reaches Claude Code that you start from a login shell. It doesn't reach a Desktop SSH session, because Desktop doesn't start Claude Code through a login shell.
466* **A value has a space inside it**: Claude Code then copies none of the keys onto events or datapoints and reports no error. [Take the space out of the value](#multi-team-organization-support).
467* **Something else already sets the variable**: in a session that the desktop app starts, a variable already set in the launch environment [takes precedence over settings files](/docs/en/settings-reference#how-env-values-interact-with-your-shell). The [debug log](/docs/en/debug-your-config) names each ignored variable. When a third-party Desktop deployment [names an OTLP endpoint](#how-managed-settings-lock-the-otlp-destination) in the environment it provides, that environment carries Desktop's own `OTEL_RESOURCE_ATTRIBUTES`.
468
439469### Example configurations
440470
441471Set these environment variables before running `claude`. Each scenario below shows a complete configuration, and each variable is described under [Common configuration variables](#common-configuration-variables). To confirm a configuration took effect, check your backend for the `claude_code.session.count` metric after starting a session; the [Quick start](#quick-start) covers logs-only verification and what to check when nothing arrives.
from line 1614
15841614
15851615All metrics and events are exported with the following resource attributes:
15861616
1587* `service.name`: `claude-code` for terminal sessions, `claude-code-desktop` for sessions started from the Code tab in the [Claude Desktop app](/docs/en/desktop)
1588* `service.version`: Current Claude Code version, or the Desktop app version for Code tab sessions
1617* `service.name`: `claude-code` for terminal sessions, `claude-code-desktop` for local sessions started from the Code tab in the [Claude Desktop app](/docs/en/desktop)
1618* `service.version`: Current Claude Code version, or the Desktop app version for local Code tab sessions
15891619* `os.type`: Operating system type (for example, `linux`, `darwin`, `windows`)
15901620* `os.version`: Operating system version string
15911621* `host.arch`: Host architecture (for example, `amd64`, `arm64`)
from line 1622
15921622* `wsl.version`: WSL version number (only present when running on Windows Subsystem for Linux)
15931623* Meter Name: `com.anthropic.claude_code`
15941624
1595If your collector pipelines or dashboards filter on `service.name = claude-code`, add `claude-code-desktop` to the filter to also capture telemetry from Code tab sessions.
1625If your collector pipelines or dashboards filter on `service.name = claude-code`, add `claude-code-desktop` to the filter to also capture telemetry from local Code tab sessions.
15961626
15971627## ROI measurement resources
15981628
No line in this hunk matches that.