func ConnStateMetrics(g prometheus.Gauge) ConnStateFunc { return func(c net.Conn, s http.ConnState) { switch s { case http.StateNew: g.Inc() case http.StateClosed: g.Dec() } } }