|
44 | 44 | Buckets: []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
|
45 | 45 | }, []string{"operation"})
|
46 | 46 |
|
| 47 | + // ExternalAPICalls is a counter metric of the number of external |
| 48 | + // API calls. "service" and "operation" labels could be used to |
| 49 | + // classify calls into a two-level hierarchy, in which calls are |
| 50 | + // "operations" that belong to a "service". Users should beware of |
| 51 | + // performance implications of high cardinality that could occur |
| 52 | + // when there are many services and operations. See: |
| 53 | + // https://prometheus.io/docs/practices/naming/#labels |
| 54 | + ExternalAPICalls = prometheus.NewCounterVec(prometheus.CounterOpts{ |
| 55 | + Namespace: promNSUpjet, |
| 56 | + Subsystem: promSysResource, |
| 57 | + Name: "external_api_calls_total", |
| 58 | + Help: "The number of external API calls.", |
| 59 | + }, []string{"service", "operation"}) |
| 60 | + |
47 | 61 | // DeletionTime is the histogram metric for collecting statistics on the
|
48 | 62 | // intervals between the deletion timestamp and the moment when
|
49 | 63 | // the resource is observed to be missing (actually deleted).
|
@@ -174,5 +188,5 @@ func (r *MetricRecorder) Start(ctx context.Context) error {
|
174 | 188 | }
|
175 | 189 |
|
176 | 190 | func init() {
|
177 |
| - metrics.Registry.MustRegister(CLITime, CLIExecutions, TFProcesses, TTRMeasurements, ExternalAPITime, DeletionTime, ReconcileDelay) |
| 191 | + metrics.Registry.MustRegister(CLITime, CLIExecutions, TFProcesses, TTRMeasurements, ExternalAPITime, ExternalAPICalls, DeletionTime, ReconcileDelay) |
178 | 192 | }
|
0 commit comments