Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <v.shushlin@gmail.com>2022-01-28 15:47:48 +0300
committerVladimir Shushlin <v.shushlin@gmail.com>2022-01-31 16:37:22 +0300
commitadc0b9233fa4a0b2b449e27336d9ae39c75819ba (patch)
tree3c21a4379bfdbcc459b27742f4dbf97122aacfc8 /app_test.go
parent008e2afc8d6de32a30696dbf813ebc0fdf5192c7 (diff)
fix: fix metrics and logs not including domain resolution time
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 https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/157/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 commits moves metrics and logging middlewares almost to the top of pipeline. Changelog: fixed
Diffstat (limited to 'app_test.go')
-rw-r--r--app_test.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/app_test.go b/app_test.go
index db4d9d67..3b1d6697 100644
--- a/app_test.go
+++ b/app_test.go
@@ -118,8 +118,7 @@ func TestHealthCheckMiddleware(t *testing.T) {
r := httptest.NewRequest("GET", tc.path, nil)
rr := httptest.NewRecorder()
- middleware, err := app.healthCheckMiddleware(handler)
- require.NoError(t, err)
+ middleware := app.healthCheckMiddleware(handler)
middleware.ServeHTTP(rr, r)
require.Equal(t, tc.status, rr.Code)