{"record":{"id":"d9f502cbe5e0aaf5","repo":"juspay/hyperswitch","slug":"failed-to-build-traces-exporter","errorCode":null,"errorMessage":"Failed to build traces exporter","messagePattern":"Failed to build traces exporter","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router_env/src/logger/setup.rs","lineNumber":317,"sourceCode":"    // Set the export interval to 1 second\n    let batch_config = trace::BatchConfigBuilder::default()\n        .with_scheduled_delay(Duration::from_millis(1000))\n        .build();\n\n    let exporter_result = opentelemetry_otlp::SpanExporter::builder()\n        .with_tonic()\n        .with_export_config(get_opentelemetry_exporter_config(config))\n        .build();\n\n    let exporter = if config.ignore_errors {\n        #[allow(clippy::print_stderr)] // The logger hasn't been initialized yet\n        exporter_result\n            .inspect_err(|error| eprintln!(\"Failed to build traces exporter: {error:?}\"))\n            .ok()?\n    } else {\n        // Safety: This is conditional, there is an option to avoid this behavior at runtime.\n        #[allow(clippy::expect_used)]\n        exporter_result.expect(\"Failed to build traces exporter\")\n    };\n\n    let mut provider_builder = trace::TracerProvider::builder()\n        .with_span_processor(\n            trace::BatchSpanProcessor::builder(\n                exporter,\n                // The runtime would have to be updated if a different web framework is used\n                opentelemetry_sdk::runtime::TokioCurrentThread,\n            )\n            .with_batch_config(batch_config)\n            .build(),\n        )\n        .with_sampler(trace::Sampler::ParentBased(Box::new(ConditionalSampler(\n            TraceAssertion {\n                clauses: config\n                    .route_to_trace\n                    .clone()\n                    .map(|inner| inner.into_iter().map(TraceUrlAssert::from).collect()),","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/router_env/src/logger/setup.rs#L299-L335","documentation":"Error \"Failed to build traces exporter\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router_env/src/logger/setup.rs:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the OTLP traces endpoint/configuration and that the collector is reachable"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"705a3219504c3cf9034e71d956455f8834ea4e64","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}