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

Traces "path group" is not transformed correctly #6421

Open
aallou opened this issue Dec 28, 2023 · 4 comments
Open

Traces "path group" is not transformed correctly #6421

aallou opened this issue Dec 28, 2023 · 4 comments

Comments

@aallou
Copy link

aallou commented Dec 28, 2023

Using Java 17 and APM agent :

For a specific endpoint, i have a strange behaviour :

Sometimes my traces are displayed like this : http.path_group : /films/actor_id/notes (with actor_id is different per actor)
Examples :
http.path_group : /films/paul/notes
http.path_group : /films/paul/notes
http.path_group : /films/paul/notes

And sometimes, they are displayed like : http.path_group : /films/?/notes (so the path variable is recognized)

So, logically, all traces should be displayed like : http.path_group : /films/?/notes

@joni-
Copy link

joni- commented Jan 16, 2024

We are seeing similar issue with resource grouping under the Resource pane in APM. Our service defines a route with path variable but the calls are not grouped under single resource in APM. We are seeing most of them as separate resources when calling the endpoint with different parameters. Some calls are grouped correctly but very small portion of them (I ran a brief test and only 10 out of ~1000 requests got grouped correctly).

We use Kotlin, JDK 21 and Ktor with Netty. dd-java-agent version is 1.27.0.

Here's a simplified version of how we define our routing in Ktor. We'd expect to see all requests go under /v1/foo/? resource in APM.

embeddedServer(Netty, port = 8080) {
    routing {
        route("/v1") {
            get("/foo/{slug}") {
                call.respond(HttpStatusCode.OK)
            }
        }
    }
}.start(wait = true)

@shedrach-deliverr
Copy link

Seeing the issue using Java 8, Jetty 9.4, dd-java-agent v1.13.0

@hoanghun
Copy link

@joni- Was this issue fixed for you?

I am also seeing this issue, using Kotlin, Jetty 12.09 and dd-java-agent 1.34.0

@joni-
Copy link

joni- commented May 31, 2024

@joni- Was this issue fixed for you?

I am also seeing this issue, using Kotlin, Jetty 12.09 and dd-java-agent 1.34.0

We ended up doing something like this to get the grouping work properly. Does the job for us.

    get("/foo/{slug}") {
        val span = GlobalTracer.get().activeSpan()
        span?.setTag("http.path_group", "/foo/{slug}")
        span?.setTag(DDTags.RESOURCE_NAME, "GET /foo/{slug}")
        ...
    }

This page describes the logic behind quantization in more detail: https://docs.datadoghq.com/tracing/troubleshooting/quantization/

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

4 participants