mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Specialize OpenTelemetry providers for HTTP traces and metrics (#62854)
## Why The code-mode host exports traces over OTLP/HTTP, and the elevated Windows Filtering Platform setup helper exports Statsig metrics. Both used the general-purpose provider, which made exporter builders for unused signals and transports reachable from those binaries. ## What changed Add `OtelProvider::try_new_http_traces` for the code-mode host and `OtelProvider::try_new_http_metrics` for the Windows setup helper. Select exporter builders at compile time so each constructor reaches only the builders it needs. Both constructors reject unsupported signals and gRPC configuration. The metrics constructor also accepts Statsig. ## Testing Add unit tests for unsupported signals and gRPC configuration. Exercise the specialized constructors in the HTTP loopback tests for trace delivery on a current-thread Tokio runtime and cumulative metrics export. GitOrigin-RevId: 875916791f0176839764c51b5ab289d5dc45a4d2
This commit is contained in:
@@ -103,7 +103,7 @@ fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
fn build_trace_provider(endpoint: &str) -> anyhow::Result<OtelProvider> {
|
||||
OtelProvider::try_new(&OtelSettings {
|
||||
OtelProvider::try_new_http_traces(&OtelSettings {
|
||||
headers_helper: None,
|
||||
http_client_factory: codex_http_client::HttpClientFactory::new(
|
||||
codex_http_client::OutboundProxyPolicy::ReqwestDefault,
|
||||
|
||||
Reference in New Issue
Block a user