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:
authorKassio Borges <kborges@gitlab.com>2022-03-11 08:08:48 +0300
committerJaime Martinez <jmartinez@gitlab.com>2022-03-11 08:08:48 +0300
commit21ca388dd09d8306268f717c0d2c28196b085d6a (patch)
treebd4e1dcc74e312863f5356e8ec3d4fc09a60c76e /app.go
parent3ce95814cd7ef50bfba7454299a685cfe74a05ae (diff)
Add correlation_id to all exception captures
Diffstat (limited to 'app.go')
-rw-r--r--app.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app.go b/app.go
index 59574000..4fac3295 100644
--- a/app.go
+++ b/app.go
@@ -18,7 +18,6 @@ import (
"github.com/rs/cors"
"gitlab.com/gitlab-org/go-mimedb"
"gitlab.com/gitlab-org/labkit/correlation"
- "gitlab.com/gitlab-org/labkit/errortracking"
"gitlab.com/gitlab-org/labkit/log"
labmetrics "gitlab.com/gitlab-org/labkit/metrics"
"gitlab.com/gitlab-org/labkit/monitoring"
@@ -29,6 +28,7 @@ import (
cfg "gitlab.com/gitlab-org/gitlab-pages/internal/config"
"gitlab.com/gitlab-org/gitlab-pages/internal/customheaders"
"gitlab.com/gitlab-org/gitlab-pages/internal/domain"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/errortracking"
"gitlab.com/gitlab-org/gitlab-pages/internal/handlers"
"gitlab.com/gitlab-org/gitlab-pages/internal/httperrors"
"gitlab.com/gitlab-org/gitlab-pages/internal/logging"
@@ -134,7 +134,7 @@ func (a *theApp) tryAuxiliaryHandlers(w http.ResponseWriter, r *http.Request, ht
if _, err := domain.GetLookupPath(r); err != nil {
if errors.Is(err, gitlab.ErrDiskDisabled) {
- errortracking.Capture(err, errortracking.WithStackTrace())
+ errortracking.CaptureErrWithReqAndStackTrace(err, r)
httperrors.Serve500(w)
return true
}
@@ -501,7 +501,7 @@ func handlePanicMiddleware(handler http.Handler) http.Handler {
err := fmt.Errorf("panic trace: %v", i)
metrics.PanicRecoveredCount.Inc()
logging.LogRequest(r).WithError(err).Error("recovered from panic")
- errortracking.Capture(err, errortracking.WithRequest(r), errortracking.WithContext(r.Context()), errortracking.WithStackTrace())
+ errortracking.CaptureErrWithReqAndStackTrace(err, r)
httperrors.Serve500(w)
}
}()