Open gliderkite opened 11 months ago
What you may want to consider is setting http.route
https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/, that should be more related to the Primary operation. However, this is interesting because it seems like something isn't getting translated correctly.
Do you have a minimal working example?
What you may want to consider is setting
http.route
https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/, that should be more related to the Primary operation. However, this is interesting because it seems like something isn't getting translated correctly. Do you have a minimal working example?
I do actually already set the http.route
, I just omitted it in the example above for brevity
TraceLayer::new_for_http()
.make_span_with(|request: &Request<_>| {
let route = request
.extensions()
.get::<MatchedPath>()
.map(MatchedPath::as_str);
info_span!(
"http_request",
"http.method" = ?request.method(),
"http.route" = route,
"http.status_code" = Empty,
"http.version" = ?request.version(),
"otel.kind" = "server",
"headers" = ?request.headers(),
)
}
I do not have a minimal working example as this is not code I can share in full, but if it helps it'd be relatively easy to extract the main parts, please let me know if there is anything in specific you'd want me to share. Thanks.
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
I use
axum
as web server and add aTraceLayer
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 followI 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 attributeotel.kind
when this is created, for example:Is there a way to change what is shown in DataDog as
opentelemetry_otlp
(that seems to be theotel.library.name
)?