davidB / tracing-opentelemetry-instrumentation-sdk

Middlewares and tools to integrate axum + tracing + opentelemetry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong service name used in jaeger initialization

cschaible opened this issue · comments

The following code in tools.rs sets the wrong value as service name:

fn init_tracer_jaeger(resource: Resource) -> Result<sdktrace::Tracer, TraceError> {
    ...

    opentelemetry_jaeger::new_pipeline()
        .with_service_name(env!("CARGO_PKG_NAME"))

It takes the crate name (axum-tracing-opentelemetry) instead of the user's crate name.

It would be better to be able to customize the service name with a separate function parameter / or reading it from the Resource object.

fix should be part of 0.3.0: the service name is retrieved from Resource as suggested