open-telemetry / opentelemetry.io

The OpenTelemetry website and documentation
https://opentelemetry.io
Creative Commons Attribution 4.0 International
565 stars 1.22k forks source link

Otel exporter docs for rust #5473

Open ashupednekar opened 1 month ago

ashupednekar commented 1 month ago

What needs to be changed?

The init_tracer function in the docs is as follows

fn init_tracer() {
    match SpanExporter::new_tonic(ExportConfig::default(), TonicConfig::default()) {
        Ok(exporter) => {
            global::set_text_map_propagator(TraceContextPropagator::new());
            let provider = TracerProvider::builder()
                .with_simple_exporter(exporter)
                .build();
            global::set_tracer_provider(provider);
        },
        Err(why) => panic!("{:?}", why)
    }

}

Is there any reason for having it this way? why not just do unwrap ?

What is the name + path of the page that needs changed?

The docs section in question is https://opentelemetry.io/docs/languages/rust/exporters/

ashupednekar commented 1 month ago

I didn't mean to add the bug label... not sure how to change that

ashupednekar commented 1 month ago

Also, where is the SpanExporter imported from?

tried opentelemetry_otlp::SpanExporter...

says no function or associated item new_tonic... is it behind any feature flags?

svrnm commented 1 month ago

@open-telemetry/rust-approvers please take a look

thanks @ashupednekar