@@ -17,9 +17,6 @@ limitations under the License.
17
17
package metrics
18
18
19
19
import (
20
- "net/url"
21
- "time"
22
-
23
20
"github.com/prometheus/client_golang/prometheus"
24
21
reflectormetrics "k8s.io/client-go/tools/cache"
25
22
clientmetrics "k8s.io/client-go/tools/metrics"
@@ -32,7 +29,6 @@ import (
32
29
// Metrics subsystem and all of the keys used by the rest client.
33
30
const (
34
31
RestClientSubsystem = "rest_client"
35
- LatencyKey = "request_latency_seconds"
36
32
ResultKey = "requests_total"
37
33
)
38
34
@@ -51,13 +47,6 @@ const (
51
47
52
48
var (
53
49
// client metrics
54
- requestLatency = prometheus .NewHistogramVec (prometheus.HistogramOpts {
55
- Subsystem : RestClientSubsystem ,
56
- Name : LatencyKey ,
57
- Help : "Request latency in seconds. Broken down by verb and URL." ,
58
- Buckets : prometheus .ExponentialBuckets (0.001 , 2 , 10 ),
59
- }, []string {"verb" , "url" })
60
-
61
50
requestResult = prometheus .NewCounterVec (prometheus.CounterOpts {
62
51
Subsystem : RestClientSubsystem ,
63
52
Name : ResultKey ,
@@ -126,13 +115,11 @@ func init() {
126
115
// registerClientMetrics sets up the client latency metrics from client-go
127
116
func registerClientMetrics () {
128
117
// register the metrics with our registry
129
- Registry .MustRegister (requestLatency )
130
118
Registry .MustRegister (requestResult )
131
119
132
120
// register the metrics with client-go
133
121
clientmetrics .Register (clientmetrics.RegisterOpts {
134
- RequestLatency : & latencyAdapter {metric : requestLatency },
135
- RequestResult : & resultAdapter {metric : requestResult },
122
+ RequestResult : & resultAdapter {metric : requestResult },
136
123
})
137
124
}
138
125
@@ -158,14 +145,6 @@ func registerReflectorMetrics() {
158
145
// copied (more-or-less directly) from k8s.io/kubernetes setup code
159
146
// (which isn't anywhere in an easily-importable place).
160
147
161
- type latencyAdapter struct {
162
- metric * prometheus.HistogramVec
163
- }
164
-
165
- func (l * latencyAdapter ) Observe (verb string , u url.URL , latency time.Duration ) {
166
- l .metric .WithLabelValues (verb , u .String ()).Observe (latency .Seconds ())
167
- }
168
-
169
148
type resultAdapter struct {
170
149
metric * prometheus.CounterVec
171
150
}
0 commit comments