fix: fix metrics and logs not including domain resolution time
What does this MR do?
Currently, we do logging and metrics capturing after we did the domain information lookup.
It allows us to add more information to access logs.
But it also distorts metrics because domain information lookup takes time.
This logic was originally introduced in !157 (merged) (diffs)
It didn't matter back than because we didn't lookup domain via API as we do now. Now it does matter.
So this MR moves metrics and logging middlewares almost to the top of the pipeline.
TODO
-
I added the Changelog
trailer (e.g.Changelog: added
) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Edited by Vladimir Shushlin