Skip to content

get route info in spring-cloud-gateway with opentelemetry-spring-boot-starter #14395

@damianofontana-satispay

Description

@damianofontana-satispay

Describe the bug

Metrics for dynamic routes exposed by Spring Cloud Gateway do not include the http.route attribute. The same issue was previously found in the Java agent and addressed here: #9597

Steps to reproduce

Create a spring cloud gateway application with 'io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter'

Expected behavior

http.route attribute filled with the correct information

Actual behavior

While using spring-cloud-gateway, we always get null http.route because spring-cloud-gateway does not put the HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE in exchange object,

Javaagent or library instrumentation version

opentelemetry-spring-boot-starter 2.18.1

Environment

JDK: 21
OS: macOs 15:4
Spring Cloud Gateway: 2023.0.0
opentelemetry-spring-boot-starter: 2.18.1

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

    contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions