spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.55k stars 3.33k forks source link

Use GATEWAY_REQUEST_URL_ATTR value as tag in GatewayMetricsFilter #487

Open ghost opened 6 years ago

ghost commented 6 years ago

I am using the Gateway for a route service in Cloud Foundry by applying the CloudFoundryRouteService predicate and the RequestHeaderToRequestUri filter for forwarding the request. The GatewayMetricsFilter uses the URI attribute of the route for tagging, but this URI value is irrelevant with the RequestHeaderToRequestUri filter.

Would it make sense to use the GATEWAY_REQUEST_URL_ATTR value (probably only its scheme, host and port) either as an additional tag or even as a replacement for the route's URI attribute? I could create a PR as it is only a small change but I am not sure if I'm missing something.

ryanjbaxter commented 6 years ago

I think that makes sense since that is the URL we actually use when routing the request.