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
path: root/app.go
diff options
context:
space:
mode:
authorIgor Wiedler <iwiedler@gitlab.com>2020-05-07 11:38:28 +0300
committerIgor Wiedler <iwiedler@gitlab.com>2020-05-07 11:38:28 +0300
commit838f82dbd717104ceb5e9cdbb09535090f18c0c6 (patch)
treeca22e51c4541662e237c468f02265e3d01cd46b2 /app.go
parentb0cb05d06af0febd485e0c15a3a71f610d91cb45 (diff)
parent71417ad27d55fe2dd197f21d4a1454fb3bb552eb (diff)
Merge remote-tracking branch 'origin/master' into update-labkit
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/app.go b/app.go
index e0d2e1fa..ce78b097 100644
--- a/app.go
+++ b/app.go
@@ -13,8 +13,8 @@ import (
"github.com/rs/cors"
log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/labkit/errortracking"
- "gitlab.com/gitlab-org/labkit/metrics"
"gitlab.com/gitlab-org/labkit/monitoring"
+ labmetrics "gitlab.com/gitlab-org/labkit/metrics"
mimedb "gitlab.com/lupine/go-mimedb"
"gitlab.com/gitlab-org/gitlab-pages/internal/acme"
@@ -28,6 +28,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/netutil"
"gitlab.com/gitlab-org/gitlab-pages/internal/request"
"gitlab.com/gitlab-org/gitlab-pages/internal/source"
+ "gitlab.com/gitlab-org/gitlab-pages/metrics"
)
const (
@@ -74,7 +75,7 @@ func (a *theApp) ServeTLS(ch *tls.ClientHelloInfo) (*tls.Certificate, error) {
func (a *theApp) healthCheck(w http.ResponseWriter, r *http.Request, https bool) {
if a.isReady() {
- w.Write([]byte("success"))
+ w.Write([]byte("success\n"))
} else {
http.Error(w, "not yet ready", http.StatusServiceUnavailable)
}
@@ -162,6 +163,7 @@ func (a *theApp) routingMiddleware(handler http.Handler) http.Handler {
// middleware chain and simply respond with 502 after logging this
host, domain, err := a.getHostAndDomain(r)
if err != nil {
+ metrics.DomainsSourceFailures.Inc()
log.WithError(err).Error("could not fetch domain information from a source")
httperrors.Serve502(w)
@@ -334,7 +336,7 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) {
}
// Metrics
- metricsMiddleware := metrics.NewHandlerFactory(metrics.WithNamespace("gitlab_pages"))
+ metricsMiddleware := labmetrics.NewHandlerFactory(labmetrics.WithNamespace("gitlab_pages"))
handler = metricsMiddleware(handler)
handler = a.routingMiddleware(handler)