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

Get http.route while using spring-cloud-gateway #9596

Closed
123liuziming opened this issue Oct 2, 2023 · 0 comments
Closed

Get http.route while using spring-cloud-gateway #9596

123liuziming opened this issue Oct 2, 2023 · 0 comments
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@123liuziming
Copy link
Contributor

123liuziming commented Oct 2, 2023

Is your feature request related to a problem? Please describe.

image
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, which is inconvenient for the user because we group metrics by this attribute.
If we get the http.route, we may show the overall metrics like the pic below:
image
or there is only an overall metrics item, which is unfriendly to users.

Describe the solution you'd like

Add a spring-cloud-gateway instrumentation to get the matched route as the http.route attribute:

  1. The httpRouteGetter returns a string in the following format Route@${route_id}
  2. Record the route's detail information in Spring Webflux's span attributes

Describe alternatives you've considered

Record spring-cloud-gateway's route info in spring webflux's HttpServerRouteGetter directly. It can result in coupling between modules.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant