Skip to content

Commit db53261

Browse files
committed
Try to make naming of next client clearer
1 parent 5e90e3f commit db53261

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

prometheus/promhttp/middleware.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
// ClientTrace adds middleware providing a histogram of outgoing request
3434
// latencies, partitioned by http client, request host and httptrace event.
35-
func ClientTrace(obs prometheus.ObserverVec, c httpClient) httpClient {
35+
func ClientTrace(obs prometheus.ObserverVec, next httpClient) httpClient {
3636
// The supplied histogram NEEDS a label for the httptrace event.
3737
// TODO: Using `event` for now, but any other name is acceptable.
3838

@@ -79,16 +79,16 @@ func ClientTrace(obs prometheus.ObserverVec, c httpClient) httpClient {
7979
}
8080
r = r.WithContext(httptrace.WithClientTrace(context.Background(), trace))
8181

82-
return c.Do(r)
82+
return next.Do(r)
8383
})
8484
}
8585

8686
// InFlight is middleware that instruments number of open requests partitioned
8787
// by http client and request host.
88-
func InFlightC(gauge prometheus.Gauge, c httpClient) httpClient {
88+
func InFlightC(gauge prometheus.Gauge, next httpClient) httpClient {
8989
return ClientMiddleware(func(r *http.Request) (*http.Response, error) {
9090
gauge.Inc()
91-
resp, err := c.Do(r)
91+
resp, err := next.Do(r)
9292
if err != nil {
9393
return nil, err
9494
}
@@ -97,11 +97,11 @@ func InFlightC(gauge prometheus.Gauge, c httpClient) httpClient {
9797
})
9898
}
9999

100-
func CounterC(counter *prometheus.CounterVec, c httpClient) httpClient {
100+
func CounterC(counter *prometheus.CounterVec, next httpClient) httpClient {
101101
code, method := checkLabels(counter)
102102

103103
return ClientMiddleware(func(r *http.Request) (*http.Response, error) {
104-
resp, err := c.Do(r)
104+
resp, err := next.Do(r)
105105
if err != nil {
106106
return nil, err
107107
}

0 commit comments

Comments
 (0)