@@ -30,11 +30,11 @@ import (
3030 dto "github.com/prometheus/client_model/go"
3131)
3232
33- // ClientTrace accepts an ObserverVec interface and an httpClient , returning a
34- // new httpClient that wraps the supplied httpClient. The provided ObserverVec
35- // must be registered in a registry in order to be used. Note: Partitioning
36- // histograms is expensive.
37- func ClientTrace (obs prometheus.ObserverVec , next httpClient ) httpClient {
33+ // ClientTrace accepts an ObserverVec interface and a doer , returning a
34+ // ClientMiddleware that wraps the supplied httpClient. The provided
35+ // ObserverVec must be registered in a registry in order to be used. Note:
36+ // Partitioning histograms is expensive.
37+ func ClientTrace (obs prometheus.ObserverVec , next doer ) ClientMiddleware {
3838 // The supplied ObserverVec NEEDS a label for the httptrace events.
3939 // TODO: Using `event` for now, but any other name is acceptable.
4040
@@ -85,10 +85,10 @@ func ClientTrace(obs prometheus.ObserverVec, next httpClient) httpClient {
8585 })
8686}
8787
88- // InFlightC accepts a Gauge and an httpClient , returning a new httpClient that
89- // wraps the supplied httpClient . The provided Gauge must be registered in a
90- // registry in order to be used.
91- func InFlightC (gauge prometheus.Gauge , next httpClient ) httpClient {
88+ // InFlightC accepts a Gauge and an doer , returning a new ClientMiddleware that
89+ // wraps the supplied doer . The provided Gauge must be registered in a registry
90+ // in order to be used.
91+ func InFlightC (gauge prometheus.Gauge , next doer ) ClientMiddleware {
9292 return ClientMiddleware (func (r * http.Request ) (* http.Response , error ) {
9393 gauge .Inc ()
9494 resp , err := next .Do (r )
@@ -100,10 +100,10 @@ func InFlightC(gauge prometheus.Gauge, next httpClient) httpClient {
100100 })
101101}
102102
103- // Counter accepts an CounterVec interface and an httpClient , returning a new
104- // httpClient that wraps the supplied httpClient . The provided CounterVec
105- // must be registered in a registry in order to be used.
106- func CounterC (counter * prometheus.CounterVec , next httpClient ) httpClient {
103+ // Counter accepts an CounterVec interface and an doer , returning a new
104+ // ClientMiddleware that wraps the supplied doer . The provided CounterVec must
105+ // be registered in a registry in order to be used.
106+ func CounterC (counter * prometheus.CounterVec , next doer ) ClientMiddleware {
107107 code , method := checkLabels (counter )
108108
109109 return ClientMiddleware (func (r * http.Request ) (* http.Response , error ) {
0 commit comments