[FEATURE] Add OTEL_METRICS_INCLUDE_EMAIL toggle to exclude user.email from telemetry

Resolved 💬 2 comments Opened Mar 27, 2026 by buck4chuka Closed Apr 26, 2026

Problem

Claude Code includes user.email as an OpenTelemetry resource attribute when authenticated via OAuth. The monitoring docs state it is "Always included when available."

When using Datadog's direct OTLP intake with resource_attributes_as_tags=true, user.email becomes a metric tag visible to anyone with Datadog access. This means any developer can see every other developer's Claude Code usage (tokens, cost, active time) by filtering on email.

There is no way to remove this tag after ingestion because:

  • Datadog classifies OTLP metrics as integration metrics, which cannot be mutated (tag management API, Metrics without Limits all blocked)
  • Datadog Restricted Datasets don't support metrics
  • The dd-otel-metric-config header only supports a boolean resource_attributes_as_tags, not an allowlist/denylist
  • Standing up an OTel Collector or Datadog Observability Pipeline just to strip one tag is disproportionate for a developer CLI tool

Proposed Solution

Add OTEL_METRICS_INCLUDE_EMAIL (default: true) following the same pattern as the existing toggles:

  • OTEL_METRICS_INCLUDE_SESSION_ID (default: true)
  • OTEL_METRICS_INCLUDE_VERSION (default: false)
  • OTEL_METRICS_INCLUDE_ACCOUNT_UUID (default: true)

Setting OTEL_METRICS_INCLUDE_EMAIL=false should exclude user.email from both metrics and events resource attributes.

Context

We're rolling out Claude Code telemetry to all developers via managed settings (MDM). user.account_uuid is sufficient for per-user breakdowns without exposing PII. The email tag creates unnecessary visibility of individual usage patterns across the organization.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗