From 8efb92f1dd21c7294aa0b1fd4c4facb506a615c4 Mon Sep 17 00:00:00 2001 From: Hubert Grochowski Date: Wed, 20 Mar 2024 15:00:20 +0100 Subject: [PATCH] http_proxy: allow specifying middleware prometheus opts --- http_proxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http_proxy.go b/http_proxy.go index 484778e3..fa4bdf10 100644 --- a/http_proxy.go +++ b/http_proxy.go @@ -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. @@ -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)