Add refreshable headers for OTLP HTTP exporters (#61028)

## Why

Allow collector credentials to refresh without rebuilding OpenTelemetry providers.

## What changed

Add `otel.headers_helper`, a command run from `CODEX_HOME` that returns a JSON object of header strings. Share its results across explicitly configured HTTP log, trace, and metric exporters. Refresh every 29 minutes by default, configurable through `otel.headers_helper_refresh_interval_ms`.

Helper headers override matching static headers. Failed refreshes block affected exports until the helper recovers, and HTTP redirects are disabled when helper headers are used. Repository-local configuration cannot set the helper; exporters set by admin requirements, gRPC exporters, and built-in analytics do not use it. Helper execution respects network policy.

## Testing

Add tests for shared execution, credential refresh and recovery, blocked exports after failure, network restrictions, and configuration validation. Collector tests cover header precedence across all three signals using JSON and binary HTTP encodings, including exclusion of an admin-managed exporter.

GitOrigin-RevId: 89018ac09c2c99523d3f92bf77048e7ed9dae5f2
This commit is contained in:
Abhinav
2026-11-12 05:21:30 +00:00
committed by copyberry
parent 88c5856258
commit c0cc9fc820
27 changed files with 789 additions and 13 deletions
+10
View File
@@ -3936,6 +3936,16 @@
],
"description": "Optional log exporter"
},
"headers_helper": {
"description": "Command that prints a JSON object of HTTP headers for explicit OTLP HTTP exporters. Runs from CODEX_HOME. Repository-local configuration cannot set OTel options.",
"type": "string"
},
"headers_helper_refresh_interval_ms": {
"description": "Interval between helper executions in milliseconds. Defaults to 29 minutes.",
"format": "uint64",
"minimum": 1.0,
"type": "integer"
},
"log_agent_responses": {
"description": "Opt in to logging final main-agent and spawned-subagent responses to an OTLP log exporter. Defaults to false. Response text can be sensitive and is capped at 64 KiB.",
"type": "boolean"