diff --git a/node/instrumentation.go b/node/instrumentation.go index ce43213f61a5f0c9653a6542226085ddacce0d84..6b57e7a4070e56812fc817d21c144c33e996f2a1 100644 --- a/node/instrumentation.go +++ b/node/instrumentation.go @@ -37,6 +37,13 @@ var ( }, []string{"stream", "upstream"}, ) + proxyConnections = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "proxy_connections_total", + Help: "Proxy connections.", + }, + []string{"proto"}, + ) // Node metrics. icecastUpdateFailed = prometheus.NewGauge( diff --git a/node/proxy.go b/node/proxy.go index 4ac131f8247af83511f893f51b42210137deebca..593077c6a99021827af14816c30a7913e98486d4 100644 --- a/node/proxy.go +++ b/node/proxy.go @@ -107,12 +107,14 @@ func doIcecastProxy(rw http.ResponseWriter, req *http.Request, target *url.URL, // httputil.ReverseProxy (not fully functional for sources, but // meh). if req.TLS != nil { + proxyConnections.WithLabelValues("https").Inc() u := *outreq.URL u.Path = "/" rp := httputil.NewSingleHostReverseProxy(&u) rp.ServeHTTP(rw, outreq) return } + proxyConnections.WithLabelValues("http").Inc() // Create the upstream connection and write the HTTP request // to it.