Update route attribute for apache shenyu #11233
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
When using Apache Shenyu, the server span has no route attribute because Apache Shenyu use customized SpringWebflux WebHandler.
Describe the solution you'd like
The workflow of apache shenyu is as follows
From the above workflow, the services in the gateway can be distinguished into several different groups by the path in the HTTP request received by the Apache Shenyu Broker. Therefore, when the Apache Shenyu Gateway receives an HTTP request and matches the corresponding MetaData based on the HTTP request's path, it can use the request path of this MetaData as the route of the Server Span, and this route is low-cardinality. When there is no match to the corresponding MetaData, it means that it may be accessing the extranet through the gateway, and then the Request Path is high base and no route update will be done in this senario.
When we implement it, we follow the following process
org.apache.shenyu.plugin.global.DefaultShenyuContextBuilder#build
method completes, put the generated MetaData and put it into the ServerWebExchange.org.apache.shenyu.plugin.global.GlobalPlugin#execute
method executes, get the path of the corresponding MetaData from the ServerWebExchange and update the route of the span.Describe alternatives you've considered
record the name of Metadata as the route of the span.
Additional context
No response
The text was updated successfully, but these errors were encountered: