@@ -25,8 +25,7 @@ const (
25
25
)
26
26
27
27
// httpTimeUntilHeader collects measurements of how long it takes
28
- // the boundary system to hijack an HTTP request into a websocket connection
29
- // for the proxy worker.
28
+ // the boundary worker to write back the first header to the requester.
30
29
var httpTimeUntilHeader prometheus.ObserverVec = prometheus .NewHistogramVec (
31
30
prometheus.HistogramOpts {
32
31
Namespace : globals .MetricNamespace ,
@@ -61,10 +60,10 @@ func pathLabel(incomingPath string) string {
61
60
return invalidPathValue
62
61
}
63
62
64
- // InstrumentProxyHttpHandler provides a proxy handler which measures
65
- // time until header is returned form the server and attaches status code,
66
- // method, and path labels for each of these measurements.
67
- func InstrumentProxyHttpHandler (wrapped http.Handler ) http.Handler {
63
+ // InstrumentHttpHandler provides a handler which measures time until header
64
+ // is written by the server and attaches status code, method, and path
65
+ // labels for the relevant measurements.
66
+ func InstrumentHttpHandler (wrapped http.Handler ) http.Handler {
68
67
return http .HandlerFunc (func (rw http.ResponseWriter , req * http.Request ) {
69
68
l := prometheus.Labels {
70
69
labelHttpPath : pathLabel (req .URL .Path ),
@@ -76,10 +75,10 @@ func InstrumentProxyHttpHandler(wrapped http.Handler) http.Handler {
76
75
})
77
76
}
78
77
79
- // InstrumentProxyHttpCollectors registers the proxy collectors to the default
80
- // prometheus register and initializes them to 0 for all possible label
78
+ // InitializeHttpCollectors registers the proxy collectors to the provided
79
+ // prometheus register and initializes them to 0 for the most likely label
81
80
// combinations.
82
- func InstrumentProxyHttpCollectors (r prometheus.Registerer ) {
81
+ func InitializeHttpCollectors (r prometheus.Registerer ) {
83
82
if r == nil {
84
83
return
85
84
}
0 commit comments