Skip to content

Commit

Permalink
http_proxy: allow specifying middleware prometheus opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Choraden authored and mmatczuk committed Jun 11, 2024
1 parent 9ccab01 commit 8efb92f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ type HTTPProxyConfig struct {
ConnectTimeout time.Duration
ReadLimit SizeSuffix
WriteLimit SizeSuffix
PromHTTPOpts []middleware.PrometheusOpt

// TestingHTTPHandler uses Martian's [http.Handler] implementation
// over [http.Server] instead of the default TCP server.
Expand Down Expand Up @@ -366,7 +367,7 @@ func (hp *HTTPProxy) middlewareStack() (martian.RequestResponseModifier, *martia
}

if hp.config.PromRegistry != nil {
p := middleware.NewPrometheus(hp.config.PromRegistry, hp.config.PromNamespace)
p := middleware.NewPrometheus(hp.config.PromRegistry, hp.config.PromNamespace, hp.config.PromHTTPOpts...)
stack.AddRequestModifier(p)
stack.AddResponseModifier(p)

Expand Down

0 comments on commit 8efb92f

Please sign in to comment.