@@ -66,11 +66,10 @@ var (
66
66
Buckets : prometheus .ExponentialBuckets (1 , 2 , 13 ),
67
67
},
68
68
[]string {
69
- "operation" , // endpoint operation
70
- "neg_type" , // type of neg
71
- "api_version" , // GCE API version
72
- "result" , // result of the sync
73
- "providerconfig_id" , // provider config ID if multi-project NEG
69
+ "operation" , // endpoint operation
70
+ "neg_type" , // type of neg
71
+ "api_version" , // GCE API version
72
+ "result" , // result of the sync
74
73
},
75
74
)
76
75
83
82
Buckets : prometheus .ExponentialBuckets (1 , 2 , 13 ),
84
83
},
85
84
[]string {
86
- "operation" , // endpoint operation
87
- "neg_type" , // type of neg
88
- "result" , // result of the sync
89
- "providerconfig_id" , // provider config ID if multi-project NEG
85
+ "operation" , // endpoint operation
86
+ "neg_type" , // type of neg
87
+ "result" , // result of the sync
90
88
},
91
89
)
92
90
@@ -102,7 +100,6 @@ var (
102
100
"neg_type" , //type of neg
103
101
"endpoint_calculator_mode" , // type of endpoint calculator used
104
102
"result" , // result of the sync
105
- "providerconfig_id" , // provider config ID if multi-project NEG
106
103
},
107
104
)
108
105
@@ -115,23 +112,19 @@ var (
115
112
Buckets : prometheus .ExponentialBuckets (1 , 2 , 13 ),
116
113
},
117
114
[]string {
118
- "process" , // type of manager process loop
119
- "result" , // result of the process
120
- "providerconfig_id" , // provider config ID if multi-project NEG
115
+ "process" , // type of manager process loop
116
+ "result" , // result of the process
121
117
},
122
118
)
123
119
124
- InitializationLatency = prometheus .NewHistogramVec (
120
+ InitializationLatency = prometheus .NewHistogram (
125
121
prometheus.HistogramOpts {
126
122
Subsystem : negControllerSubsystem ,
127
123
Name : "neg_initialization_duration_seconds" ,
128
124
Help : "Initialization latency of a NEG" ,
129
125
// custom buckets - [1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s, 256s(~4min), 512s(~8min), 1024s(~17min), 2048 (~34min), 4096(~68min), +Inf]
130
126
Buckets : prometheus .ExponentialBuckets (1 , 2 , 13 ),
131
127
},
132
- []string {
133
- "providerconfig_id" , // provider config ID if multi-project NEG
134
- },
135
128
)
136
129
137
130
LastSyncTimestamp = prometheus .NewGauge (
@@ -173,9 +166,8 @@ var (
173
166
Buckets : append ([]float64 {0 }, prometheus .ExponentialBuckets (1 , 2 , 20 )... ),
174
167
},
175
168
[]string {
176
- "neg_type" , // type of neg
177
- "endpoint_type" , // type of endpoint
178
- "providerconfig_id" , // provider config ID if multi-project NEG
169
+ "neg_type" , // type of neg
170
+ "endpoint_type" , // type of endpoint
179
171
},
180
172
)
181
173
@@ -187,9 +179,7 @@ var (
187
179
Name : "error_count" ,
188
180
Help : "Counts of server errors and NEG controller errors." ,
189
181
},
190
- []string {"error_type" ,
191
- "providerconfig_id" , // provider config ID if multi-project NEG
192
- },
182
+ []string {"error_type" },
193
183
)
194
184
195
185
LabelNumber = prometheus .NewHistogram (
@@ -228,7 +218,7 @@ var (
228
218
Name : "gce_request_count" ,
229
219
Help : "Number of requests sent by NEG Controller to Arcus." ,
230
220
},
231
- []string {"request" , "result" , "providerconfig_id" },
221
+ []string {"request" , "result" },
232
222
)
233
223
234
224
// GCERequestLatency tracks the latency of GCE requests the neg controller sends to the NEG API
@@ -240,7 +230,7 @@ var (
240
230
// custom buckets - [0.001, 0.01, 0.1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, +Inf]
241
231
Buckets : append ([]float64 {0.001 , 0.01 , 0.1 }, prometheus .ExponentialBuckets (1 , 2 , 20 )... ),
242
232
},
243
- []string {"request" , "result" , "providerconfig_id" },
233
+ []string {"request" , "result" },
244
234
)
245
235
246
236
// K8sRequestCount tracks the number of K8s requests the neg controller sends to the K8s API
@@ -250,7 +240,7 @@ var (
250
240
Name : "k8s_request_count" ,
251
241
Help : "Number of requests sent by NEG Controller to Kubernetes API Server." ,
252
242
},
253
- []string {"request" , "result" , "providerconfig_id" },
243
+ []string {"request" , "result" },
254
244
)
255
245
256
246
// K8sRequestLatency tracks the latency of K8s requests the neg controller sends to the K8s API
@@ -262,7 +252,7 @@ var (
262
252
// custom buckets - [0.001, 0.01, 0.1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, +Inf]
263
253
Buckets : append ([]float64 {0.001 , 0.01 , 0.1 }, prometheus .ExponentialBuckets (1 , 2 , 20 )... ),
264
254
},
265
- []string {"request" , "result" , "providerconfig_id" },
255
+ []string {"request" , "result" },
266
256
)
267
257
)
268
258
@@ -305,26 +295,26 @@ func NewNegMetrics(providerConfigID string) *NegMetrics {
305
295
func (m * NegMetrics ) PublishNegOperationMetrics (operation , negType , apiVersion string , err error , numEndpoints int , start time.Time ) {
306
296
result := getResult (err )
307
297
308
- NegOperationLatency .WithLabelValues (operation , negType , apiVersion , result , m . ProviderConfigID ).Observe (time .Since (start ).Seconds ())
309
- NegOperationEndpoints .WithLabelValues (operation , negType , result , m . ProviderConfigID ).Observe (float64 (numEndpoints ))
298
+ NegOperationLatency .WithLabelValues (operation , negType , apiVersion , result ).Observe (time .Since (start ).Seconds ())
299
+ NegOperationEndpoints .WithLabelValues (operation , negType , result ).Observe (float64 (numEndpoints ))
310
300
}
311
301
312
302
// PublishNegSyncMetrics publishes collected metrics for the sync of NEG
313
303
func (m * NegMetrics ) PublishNegSyncMetrics (negType , endpointCalculator string , err error , start time.Time ) {
314
304
result := getResult (err )
315
305
316
- SyncerSyncLatency .WithLabelValues (negType , endpointCalculator , result , m . ProviderConfigID ).Observe (time .Since (start ).Seconds ())
306
+ SyncerSyncLatency .WithLabelValues (negType , endpointCalculator , result ).Observe (time .Since (start ).Seconds ())
317
307
}
318
308
319
309
// PublishNegManagerProcessMetrics publishes collected metrics for the neg manager loops
320
310
func (m * NegMetrics ) PublishNegManagerProcessMetrics (process string , err error , start time.Time ) {
321
311
result := getResult (err )
322
- ManagerProcessLatency .WithLabelValues (process , result , m . ProviderConfigID ).Observe (time .Since (start ).Seconds ())
312
+ ManagerProcessLatency .WithLabelValues (process , result ).Observe (time .Since (start ).Seconds ())
323
313
}
324
314
325
315
// PublishNegInitializationMetrics publishes collected metrics for time from request to initialization of NEG
326
316
func (m * NegMetrics ) PublishNegInitializationMetrics (latency time.Duration ) {
327
- InitializationLatency .WithLabelValues ( m . ProviderConfigID ). Observe (latency .Seconds ())
317
+ InitializationLatency .Observe (latency .Seconds ())
328
318
}
329
319
330
320
func PublishNegSyncerStalenessMetrics (syncerStaleness time.Duration ) {
@@ -338,7 +328,7 @@ func PublishNegEPSStalenessMetrics(epsStaleness time.Duration) {
338
328
// PublishDegradedModeCorrectnessMetrics publishes collected metrics
339
329
// of the correctness of degraded mode calculations compared with the current one
340
330
func (m * NegMetrics ) PublishDegradedModeCorrectnessMetrics (count int , endpointType string , negType string ) {
341
- DegradeModeCorrectness .WithLabelValues (negType , endpointType , m . ProviderConfigID ).Observe (float64 (count ))
331
+ DegradeModeCorrectness .WithLabelValues (negType , endpointType ).Observe (float64 (count ))
342
332
}
343
333
344
334
// PublishNegControllerErrorCountMetrics publishes collected metrics
@@ -347,8 +337,8 @@ func (m *NegMetrics) PublishNegControllerErrorCountMetrics(err error, isIgnored
347
337
if err == nil {
348
338
return
349
339
}
350
- NegControllerErrorCount .WithLabelValues (totalNegError , m . ProviderConfigID ).Inc ()
351
- NegControllerErrorCount .WithLabelValues (getErrorLabel (err , isIgnored ), m . ProviderConfigID ).Inc ()
340
+ NegControllerErrorCount .WithLabelValues (totalNegError ).Inc ()
341
+ NegControllerErrorCount .WithLabelValues (getErrorLabel (err , isIgnored )).Inc ()
352
342
}
353
343
354
344
// PublishLabelPropagationError publishes error occured during label propagation.
@@ -374,8 +364,8 @@ func (m *NegMetrics) PublishGCERequestCountMetrics(start time.Time, requestType
374
364
result = otherError
375
365
}
376
366
}
377
- GCERequestLatency .WithLabelValues (requestType , result , m . ProviderConfigID ).Observe (time .Since (start ).Seconds ())
378
- GCERequestCount .WithLabelValues (requestType , result , m . ProviderConfigID ).Inc ()
367
+ GCERequestLatency .WithLabelValues (requestType , result ).Observe (time .Since (start ).Seconds ())
368
+ GCERequestCount .WithLabelValues (requestType , result ).Inc ()
379
369
}
380
370
381
371
// PublishK8sRequestCountMetrics publishes collected metrics for K8s Request Counts
@@ -390,8 +380,8 @@ func (m *NegMetrics) PublishK8sRequestCountMetrics(start time.Time, requestType
390
380
result = otherError
391
381
}
392
382
}
393
- K8sRequestLatency .WithLabelValues (requestType , result , m . ProviderConfigID ).Observe (time .Since (start ).Seconds ())
394
- K8sRequestCount .WithLabelValues (requestType , result , m . ProviderConfigID ).Inc ()
383
+ K8sRequestLatency .WithLabelValues (requestType , result ).Observe (time .Since (start ).Seconds ())
384
+ K8sRequestCount .WithLabelValues (requestType , result ).Inc ()
395
385
}
396
386
397
387
func getResult (err error ) string {
0 commit comments