Skip to content

instrumentation/akka/akka-http-10.0 has issues populating http.route #15503

@obs-gh-abhishekrao

Description

@obs-gh-abhishekrao

Describe the bug

There are two issues I discovered

  1. On JDK 11, route matcher does not capture the http.route attribute at all. As a result, the span name only encapsulates the HTTP method (e.g. GET).
  2. The span name and http.route are neglecting slashes when computing the route.

I've made a draft fix here with all old and new tests passing on both reproduced JDK versions - 149f216

Steps to reproduce

Using updated tests from this fix commit 149f216 pointing to the instrumentation code on main, I'm able to confirm from logs for both cases. On JDK 11, both [1] and [2] are reproducible, and [2] is also reproducible in JDK 21 target.

  1. org.opentest4j.AssertionFailedError: [Span 0] Expected span to have name <GET /api/v2/orders/*/status> but was
  2. org.opentest4j.AssertionFailedError: [Span 0] Expected span to have name <GET /foo/api/v2/bar/> but was <GET /fooapiv2bar>

Expected behavior

Span names should have been

  1. GET /api/v2/orders/*/status
  2. GET /foo/api/v2/bar/*

http.route should have been

  1. /api/v2/orders/*/status
  2. /foo/api/v2/bar/*

Actual behavior

Span names were

  1. GET (JDK11)
  2. GET /fooapiv2bar* (JDK11 & JDK21)

http.route were

  1. Missing completely
  2. /fooapiv2bar*

Javaagent or library instrumentation version

2.23.0-alpha-SNAPSHOT

Environment

JDK: JDK 11 for the first issue, JDK 11 and 21 for the second
OS: MacOS 15.5

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions