feat(gorouter): add route-service-url to access log #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During operations we've found out that it is quite hard to know wether a route uses a route service or not.
The classical example would be a route service like e.g.
rate-limiting-service.cf-app.com
which is usually hosted on the same CF deployment.In such a case, the access log would first show this entry:
Gorouter then proceeds to call the route service, which in this case also lives on the same platform, so another gorouter will log something like this:
Unless you add
x-forwarded-url
to theadditional-headers-to-log
property, it is basically impossible to correlate the two log statements. If you did that, you would get a hint:Now, if the route service happens to be outside the platform on some external URL, gorouter logs nothing at all. There are some error logs written in
proxy_round_tripper
but those will either be visible only in debug mode or if an error occurred.But if everything went fine with the external route service, gorouter would not mention it, leading people to think that
response_time_ms
applies to the backend app, when in fact it includes a round trip to the route service as well.The change proposed adds the
route_service_url
to access log if the target route has set it.Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)
Expected result after the change
Current result before the change
Links to any other associated PRs
I have viewed signed and have submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
scripts/run-unit-tests-in-docker
from routing-release.(Optional) I have run Routing Acceptance Tests and Routing Smoke Tests on bosh lite
(Optional) I have run CF Acceptance Tests on bosh lite