mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Support OTel header helpers in local managed requirements (#62110)
## What changed - Allow system `requirements.toml` and MDM requirements to set `otel.headers_helper` and `otel.headers_helper_refresh_interval_ms`, and expose both fields through the requirements API. - Require an absolute executable path and run managed helpers directly from their installation directory. Reject helper settings from cloud requirements. - Restrict managed helper headers to OTLP HTTP exporters with nonempty endpoints configured in the same requirements layer. Replacing the helper or an exporter revokes the previous binding. - Document deployment and rollback requirements, including client compatibility and pausing affected exports until a failed helper recovers. ## Testing Add coverage for exporter layer boundaries, cloud policy rejection, relative path rejection, managed helper execution and recovery, missing executable diagnostics, and requirements API output. GitOrigin-RevId: 271058010c2e3090eb97cb357b70be4dc41b43db
This commit is contained in:
@@ -87,20 +87,23 @@ pub fn build_provider(
|
||||
let service_name = service_name_override.unwrap_or(originator.value.as_str());
|
||||
let runtime_metrics = config.features.enabled(Feature::RuntimeMetrics);
|
||||
|
||||
let managed = config
|
||||
let managed_otel = config
|
||||
.config_layer_stack
|
||||
.requirements_toml()
|
||||
.otel
|
||||
.as_deref();
|
||||
let helper_targets =
|
||||
managed_otel.map(codex_config::OtelRequirementsToml::headers_helper_targets);
|
||||
let headers_helper = config
|
||||
.otel
|
||||
.headers_helper
|
||||
.as_ref()
|
||||
.map(|command| OtelHeadersHelper {
|
||||
command: command.clone(),
|
||||
apply_to_logs: managed.is_none_or(|otel| otel.exporter.is_none()),
|
||||
apply_to_traces: managed.is_none_or(|otel| otel.trace_exporter.is_none()),
|
||||
apply_to_metrics: managed.is_none_or(|otel| otel.metrics_exporter.is_none()),
|
||||
managed: managed_otel.is_some_and(|otel| otel.headers_helper.is_some()),
|
||||
apply_to_logs: helper_targets.is_none_or(|targets| targets.logs),
|
||||
apply_to_traces: helper_targets.is_none_or(|targets| targets.traces),
|
||||
apply_to_metrics: helper_targets.is_none_or(|targets| targets.metrics),
|
||||
refresh_interval: Duration::from_millis(
|
||||
config
|
||||
.otel
|
||||
|
||||
Reference in New Issue
Block a user