diff options
author | Ercan Ucan <ercan.ucan@siemens.com> | 2021-02-23 18:35:37 +0300 |
---|---|---|
committer | Ercan Ucan <ercan.ucan@siemens.com> | 2021-02-24 17:37:16 +0300 |
commit | ae9a8fb5304fca0a1dc0441cb991227320033bca (patch) | |
tree | 0ca630df4863298dba0a2f493e91f58b94deda99 /main.go | |
parent | 808300edb233f751aa6bb6abc8275774ffce936e (diff) |
fix: use correlationID middleware
As discussed within https://gitlab.com/gitlab-org/gitlab-pages/-/issues/510 this
MR adds the usage of labkit's correlationID middleware.
It uses a similar approach to the implemantion in gitlab-workhorse.
Fixes https://gitlab.com/gitlab-org/gitlab-pages/-/issues/510
:tools: with :heart: at Siemens
Changelog: fixed
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -54,6 +54,7 @@ var ( daemonUID = flag.Uint("daemon-uid", 0, "Drop privileges to this user") daemonGID = flag.Uint("daemon-gid", 0, "Drop privileges to this group") daemonInplaceChroot = flag.Bool("daemon-inplace-chroot", false, "Fall back to a non-bind-mount chroot of -pages-root when daemonizing") + propagateCorrelationID = flag.Bool("propagate-correlation-id", false, "Reuse existing Correlation-ID from the incoming request header `X-Request-ID` if present") logFormat = flag.String("log-format", "text", "The log output format: 'text' or 'json'") logVerbose = flag.Bool("log-verbose", false, "Verbose logging") _ = flag.String("admin-secret-path", "", "DEPRECATED") @@ -167,6 +168,7 @@ func configFromFlags() appConfig { config.RedirectHTTP = *redirectHTTP config.HTTP2 = *useHTTP2 config.DisableCrossOriginRequests = *disableCrossOriginRequests + config.PropagateCorrelationID = *propagateCorrelationID config.StatusPath = *pagesStatus config.LogFormat = *logFormat config.LogVerbose = *logVerbose @@ -290,6 +292,7 @@ func loadConfig() appConfig { "pages-domain": *pagesDomain, "pages-root": *pagesRoot, "pages-status": *pagesStatus, + "propagate-correlation-id": *propagateCorrelationID, "redirect-http": config.RedirectHTTP, "root-cert": *pagesRootKey, "root-key": *pagesRootCert, |