{"name":"OTEL_SERVICE_NAME","slug":"otel-service-name","family":"env","title":"Environment variables","noun":"environment variable","description":"You can now set OTEL_SERVICE_NAME, OTEL_TRACES_EXPORT_INTERVAL and CLAUDE_CODE_FORK_SUBAGENT in settings.json.","description_source":"entry","described_by":{"version":"2.1.232","anchor":"three-more-variables-can-be-set-from-settings-json"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.308","builds":0,"mined_builds":149,"first_cited":null},"aliases":[],"entries":[{"version":"2.1.232","anchor":"three-more-variables-can-be-set-from-settings-json","heading":"Three more variables can be set from settings.json","line":"You can now set OTEL_SERVICE_NAME, OTEL_TRACES_EXPORT_INTERVAL and CLAUDE_CODE_FORK_SUBAGENT in settings.json.","released_at":"2026-08-13 21:30:53","reason":"named in this entry, found in this entry's text"}],"entries_total":1,"docs":[{"source":"claude-code","path":"agent-sdk\/observability","title":"Observability with OpenTelemetry","documented":false}],"docs_total":1,"gates":[],"related":[{"name":"OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","slug":"otel-attribute-value-length-limit","description":"Claude Code caps the content it records in telemetry (prompts, system prompts, model output, tool inputs and results) at the smallest of this, `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT`, `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` and `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` (default `61440`), cutting longer content and appending a `[TRUNCATED - Content exceeds ... limit]` marker. The bundled OTel SDK reads it only as a fallback for the log record and span attribute limits, which its own defaults always fill (unlimited when their variables are unset), so it does not limit SDK attributes."},{"name":"OTEL_EXPORTER_OTLP_ENDPOINT","slug":"otel-exporter-otlp-endpoint","description":"Base URL for OTLP telemetry exports. When no signal-specific `OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT` is set, the HTTP exporters send to this URL with `\/v1\/metrics`, `\/v1\/logs` or `\/v1\/traces` appended, and the gRPC exporter uses it as given. Claude Code also reads it to pick the exporter's proxy and TLS agent options and in its gateway telemetry routing checks, and its gateway's managed settings set it to `listen.public_url` when `telemetry.forward_to` is configured."},{"name":"OTEL_EXPORTER_OTLP_HEADERS","slug":"otel-exporter-otlp-headers","description":"Telemetry exporters can now ignore OTEL_EXPORTER_OTLP_HEADERS and use only the headers given in configuration"},{"name":"OTEL_EXPORTER_OTLP_INSECURE","slug":"otel-exporter-otlp-insecure","description":"Used by the OTLP gRPC exporter when the endpoint starts with neither `http:\/\/` nor `https:\/\/`: `true` (case-insensitive, trimmed) uses insecure credentials, any other value uses TLS credentials. A non-empty signal-specific `OTEL_EXPORTER_OTLP_<SIGNAL>_INSECURE` takes precedence; `http:\/\/` endpoints are always insecure and `https:\/\/` endpoints always use TLS."},{"name":"OTEL_EXPORTER_OTLP_LOGS_ENDPOINT","slug":"otel-exporter-otlp-logs-endpoint","description":"URL for OTLP log exports, used as given without a `\/v1\/logs` suffix and taking precedence over `OTEL_EXPORTER_OTLP_ENDPOINT`. Claude Code also reads it to pick the log exporter's proxy and TLS agent options and when matching the endpoint against a collector named by gateway managed settings."},{"name":"OTEL_EXPORTER_OTLP_LOGS_HEADERS","slug":"otel-exporter-otlp-logs-headers","description":"Comma-separated `key=value` headers for OTLP log exports; the bundled exporters merge it over `OTEL_EXPORTER_OTLP_HEADERS`, its values winning on a clash. While it is set, Claude Code skips some of its built-in routes that attach its own `Authorization: Bearer` token to log exports."},{"name":"OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","slug":"otel-exporter-otlp-logs-protocol","description":"Protocol for the OTLP log exporter when `OTEL_LOGS_EXPORTER` includes `otlp`: `grpc`, `http\/json` or `http\/protobuf`. Unset or empty falls back to `OTEL_EXPORTER_OTLP_PROTOCOL`; any other value throws `Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var`."},{"name":"OTEL_EXPORTER_OTLP_METRICS_ENDPOINT","slug":"otel-exporter-otlp-metrics-endpoint","description":"In remote sessions, usage metrics can now go to the session's own metrics address, signed with `CLAUDE_CODE_SESSION_ACCESS_TOKEN`"},{"name":"OTEL_EXPORTER_OTLP_METRICS_HEADERS","slug":"otel-exporter-otlp-metrics-headers","description":"Comma-separated `key=value` headers for OTLP metric exports; the bundled exporters merge it over `OTEL_EXPORTER_OTLP_HEADERS`, its values winning on a clash. While it is set, Claude Code skips some of its built-in routes that attach its own `Authorization: Bearer` token to metric exports, including the remote session ingress collector."},{"name":"OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","slug":"otel-exporter-otlp-metrics-protocol","description":"When metrics are sent over OpenTelemetry by gRPC or HTTP protobuf, Claude Code now prepares an extra resource before creating the exporter"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/otel-service-name","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}