Skip to content

span name is not better with Java filter use #12427

@LifaPeng

Description

@LifaPeng

Describe the bug

image

The server receives requests for /test/otle and processes them in a Java filter with registration.addUrlPatterns("/test/*").

However, due to the initial route being null, the method HttpServerRoute.isBetterRoute(httpRouteState, route) always returns true, triggering the subsequent call to updateSpanName(serverSpan, httpRouteState, route), which updates the span name to /test/*.

Steps to reproduce

The server receives requests for /test/otle and processes them in a Java filter with registration.addUrlPatterns("/test/*").
The Java filter returns directly without executing chain.doFilter(request, response).

Expected behavior

In this case, /test/otle is longer than /test/*, and it is expected to use /test/otle as the final span name.

Actual behavior

now is /test/*

Javaagent or library instrumentation version

2.5.0+

Environment

JDK:
OS:

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions