Skip to content

Commit

Permalink
Add external API calls metric.
Browse files Browse the repository at this point in the history
Signed-off-by: Cem Mergenci <[email protected]>
  • Loading branch information
mergenci committed Mar 26, 2024
1 parent 2ef7077 commit 864d2aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ var (
Buckets: []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
}, []string{"operation"})

ExternalAPICalls = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: promNSUpjet,
Subsystem: promSysResource,
Name: "external_api_calls",
Help: "The number of external API calls.",
}, []string{"service", "service_operation"})

// DeletionTime is the histogram metric for collecting statistics on the
// intervals between the deletion timestamp and the moment when
// the resource is observed to be missing (actually deleted).
Expand Down Expand Up @@ -174,5 +181,5 @@ func (r *MetricRecorder) Start(ctx context.Context) error {
}

func init() {
metrics.Registry.MustRegister(CLITime, CLIExecutions, TFProcesses, TTRMeasurements, ExternalAPITime, DeletionTime, ReconcileDelay)
metrics.Registry.MustRegister(CLITime, CLIExecutions, TFProcesses, TTRMeasurements, ExternalAPITime, ExternalAPICalls, DeletionTime, ReconcileDelay)
}

0 comments on commit 864d2aa

Please sign in to comment.