juspay/hyperswitch · error

Failed to build traces exporter

Error message

Failed to build traces exporter

What it means

Error "Failed to build traces exporter" thrown in juspay/hyperswitch.

Source

Thrown at crates/router_env/src/logger/setup.rs:317

    // Set the export interval to 1 second
    let batch_config = trace::BatchConfigBuilder::default()
        .with_scheduled_delay(Duration::from_millis(1000))
        .build();

    let exporter_result = opentelemetry_otlp::SpanExporter::builder()
        .with_tonic()
        .with_export_config(get_opentelemetry_exporter_config(config))
        .build();

    let exporter = if config.ignore_errors {
        #[allow(clippy::print_stderr)] // The logger hasn't been initialized yet
        exporter_result
            .inspect_err(|error| eprintln!("Failed to build traces exporter: {error:?}"))
            .ok()?
    } else {
        // Safety: This is conditional, there is an option to avoid this behavior at runtime.
        #[allow(clippy::expect_used)]
        exporter_result.expect("Failed to build traces exporter")
    };

    let mut provider_builder = trace::TracerProvider::builder()
        .with_span_processor(
            trace::BatchSpanProcessor::builder(
                exporter,
                // The runtime would have to be updated if a different web framework is used
                opentelemetry_sdk::runtime::TokioCurrentThread,
            )
            .with_batch_config(batch_config)
            .build(),
        )
        .with_sampler(trace::Sampler::ParentBased(Box::new(ConditionalSampler(
            TraceAssertion {
                clauses: config
                    .route_to_trace
                    .clone()
                    .map(|inner| inner.into_iter().map(TraceUrlAssert::from).collect()),

View on GitHub (pinned to 705a321950)

Solutions

  1. Check the OTLP traces endpoint/configuration and that the collector is reachable

When it happens

Trigger: Thrown at crates/router_env/src/logger/setup.rs:317 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@705a321950 (2026-08-19). Data as JSON: /api/errors/d9f502cbe5e0aaf5. Report an issue: GitHub.