{"record":{"id":"3e83403b9304ca9f","repo":"openai/codex","slug":"failed-to-initialize-wfp-setup-metrics-provider","errorCode":null,"errorMessage":"failed to initialize WFP setup metrics provider: {err}","messagePattern":"failed to initialize WFP setup metrics provider: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/wfp_setup.rs","lineNumber":61,"sourceCode":"        return Ok(None);\n    };\n    // The setup helper cannot call codex-core's OTEL builder because core\n    // depends on this crate, so the parent process passes only the resolved\n    // Statsig environment in the elevation payload. Other exporters are\n    // intentionally omitted from this helper path.\n    OtelProvider::try_new(&OtelSettings {\n        environment: otel.environment.clone(),\n        service_name: WFP_SETUP_SERVICE_NAME.to_string(),\n        service_version: env!(\"CARGO_PKG_VERSION\").to_string(),\n        codex_home: codex_home.to_path_buf(),\n        exporter: OtelExporter::None,\n        trace_exporter: OtelExporter::None,\n        metrics_exporter: OtelExporter::Statsig,\n        runtime_metrics: false,\n        span_attributes: BTreeMap::new(),\n        tracestate: BTreeMap::new(),\n    })\n    .map_err(|err| anyhow::anyhow!(\"failed to initialize WFP setup metrics provider: {err}\"))\n}\n\nfn emit_wfp_setup_metric(\n    codex_home: &Path,\n    otel: Option<&StatsigMetricsSettings>,\n    metric: &WfpSetupMetric,\n) -> Result<()> {\n    let Some(provider) = build_wfp_metrics_provider(codex_home, otel)? else {\n        return Ok(());\n    };\n    if let Some(metrics) = provider.metrics() {\n        let target_account = sanitize_setup_metric_tag_value(&metric.target_account);\n        match metric.outcome {\n            WfpSetupMetricOutcome::Success => {\n                let installed_filter_count = metric.installed_filter_count.to_string();\n                metrics.counter(\n                    WFP_SETUP_SUCCESS_METRIC,\n                    /*inc*/ 1,","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/wfp_setup.rs#L43-L79","documentation":"Error \"failed to initialize WFP setup metrics provider: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/wfp_setup.rs:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the inner error, ensure the WFP provider can be registered (elevation required), and retry the sandbox network setup."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}