Skip to content
← Back to release · 2.1.269
New features / v2.1.269

Tag OpenTelemetry data with repository info

CHANGELOG · original

Added OTEL_METRICS_INCLUDE_REPOSITORY to tag OpenTelemetry metrics and events with vcs.* repository attributes; commit events get vcs.ref.head.* with OTEL_LOG_TOOL_DETAILS
Open official changelog ↗

Documentation

Documentation excerpt

Repository attributes

Set OTEL_METRICS_INCLUDE_REPOSITORY=true to tag metrics and events with the identity of the session's repository, so a shared collector can attribute usage per repository. Requires Claude Code v2.1.269 or later.

Claude Code derives these attributes once per session from the repository's origin remote. The HTTPS and SSH remotes of one repository produce identical values:

Attribute Value
vcs.repository.url.full The repository's browser URL without .git, such as https://github.com/example-org/example-repo
vcs.owner.name The owner or group path, such as example-org; omitted when the remote path has a single segment
vcs.repository.name The bare repository name, such as example-repo
vcs.provider.name github, gitlab, bitbucket, or gitea when Claude Code recognizes the remote's host or URL shape as one of those providers; omitted otherwise

Values are lowercased, and credentials, query strings, and fragments from the remote URL never appear in them. The attributes are omitted when the session has no origin remote, when the remote isn't URL-shaped, or when the only enclosing repository is your home directory.

A vcs.* key you declare in OTEL_RESOURCE_ATTRIBUTES replaces the derived value for that key. If you declare vcs.repository.url.full, Claude Code never reads the remote and reports only the keys you declare.

The attributes flow only to your own exporters; Anthropic's telemetry drops every vcs.* key.

Documentation snapshot · 2026-09-23

Change details