Help Integrating opentelemetry crate with tracing crate

Question 1:

Please can someone explain what i might be missing, code seems to work, at least spans are getting to Jaeger. but the problem is every span are sent to the collector as a separate trace, i want to make each request up to to the response a single trace.

I saw some videos and hoping that adding this line would help. but no, spans are still sent as a separate trace for each function

async fn main() -> Result<(), Box<dyn std::error::Error>> {


    let tracer = opentelemetry_jaeger::new_pipeline()

    // Create a tracing layer with the configured tracer
    let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer);
    let subscriber = Registry::default().with(otel_layer);
    println!("Test Line");
    tracing::info!("It started here");
    // spawn a task listening green thread
    let mut _grpc_handle = tokio::spawn(async move { g_rpc_server(tx).await });
    tracing::info!("It got here");

Question 2.

I notice these 2 events are not sent to Jaeger

    tracing::info!("It started here");
    tracing::info!("It got here");

but every other span from the spawn task are.

Question 2.

is there a way to filter traces to just my applications only, i don't want to see traces from dependencies.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.