Skip to content

Commit

Permalink
fix: log proxy errors with logrus (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnodorp-jaconi authored Apr 9, 2022
1 parent f55cfef commit 46bfd70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func runProxy(d driver.Driver, n *negroni.Negroni, logger *logrusx.Logger, prom
handler := &httputil.ReverseProxy{
Director: proxy.Director,
Transport: proxy,
ErrorHandler: func(w http.ResponseWriter, r *http.Request, err error) {
logger.WithError(err).Errorf("http: proxy error: %v", err)
w.WriteHeader(http.StatusBadGateway)
},
}

promCollapsePaths := d.Configuration().PrometheusCollapseRequestPaths()
Expand Down

0 comments on commit 46bfd70

Please sign in to comment.