Skip to content

How to change the DataDog primary operation name #137

Open
@gliderkite

Description

@gliderkite

I have a set of spans that I can use to monitor my HTTP services in DataDog, and I make use of a OTLP pipeline

opentelemetry_otlp::new_pipeline()
    .tracing()
    .with_exporter(
        opentelemetry_otlp::new_exporter()
            .tonic()
...

I use axum as web server and add a TraceLayer to create a new span every time I get a request. I can then see the trace and related spans in DataDog that are shown as follow

Screenshot 2023-11-02 at 12 08 14

I couldn't find a way to change/update what I think is the primary operation of the services, that is displayed for each span as opentelemetry_otlp.<kind>, making the whole thing quite noisy, to the point where short span names are not displayed because the primary operation name takes all the space available.

I was able to set the kind by setting the span attribute otel.kind when this is created, for example:

let span = info_span!(
    "http_request",
    "http.method" = ?request.method(),
    "http.version" = ?request.version(),
    "headers" = ?request.headers(),
    "otel.kind" = "server",
);

Is there a way to change what is shown in DataDog as opentelemetry_otlp (that seems to be the otel.library.name)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions