Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there anyway to share the same SpanExporter with tracing-opentelemetry? #55

Open
MrCroxx opened this issue Nov 27, 2024 · 0 comments

Comments

@MrCroxx
Copy link
Contributor

MrCroxx commented Nov 27, 2024

Hi, thanks for the cool lib!

I'm using both tracing and fastrace in my project, and want to export spans to OpenTelemetry.

I setup the tracing and opentelemetry with the following code in my project:

    let span_exporter = opentelemetry_otlp::SpanExporter::builder()
        .with_tonic()
        .with_endpoint(otel_endpoint)
        .build()
        .expect("could not build span exporter");
    let trace_config = opentelemetry_sdk::trace::Config::default()
        .with_sampler(ChromaShouldSample)
        .with_resource(resource.clone());
    let tracer_provider = opentelemetry_sdk::trace::TracerProvider::builder()
        .with_batch_exporter(span_exporter, opentelemetry_sdk::runtime::Tokio)
        .with_config(trace_config)
        .build();
    let tracer = tracer_provider.tracer(service_name.clone());

When I'm setting up as fastrace-opentelemetry readme says, I found the SpanExporter cannot be cloned. I must create another SpanExporter with another endpoint.

May I ask is there anyway to share the SpanExporter with tracing-opentelemetry? Thank you. 🥰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant