Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track auto-provisioned queued provisioning node groups. #6604

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions cluster-autoscaler/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,22 @@ var (
},
)

nodeGroupCreationCount = k8smetrics.NewCounter(
nodeGroupCreationCount = k8smetrics.NewCounterVec(
&k8smetrics.CounterOpts{
Namespace: caNamespace,
Name: "created_node_groups_total",
Help: "Number of node groups created by Node Autoprovisioning.",
},
[]string{"group_type"},
)

nodeGroupDeletionCount = k8smetrics.NewCounter(
nodeGroupDeletionCount = k8smetrics.NewCounterVec(
&k8smetrics.CounterOpts{
Namespace: caNamespace,
Name: "deleted_node_groups_total",
Help: "Number of node groups deleted by Node Autoprovisioning.",
},
[]string{"group_type"},
)

nodeTaintsCount = k8smetrics.NewGaugeVec(
Expand Down Expand Up @@ -643,12 +645,22 @@ func UpdateNapEnabled(enabled bool) {

// RegisterNodeGroupCreation registers node group creation
func RegisterNodeGroupCreation() {
nodeGroupCreationCount.Add(1.0)
RegisterNodeGroupCreationWithLabelValues("")
}

// RegisterNodeGroupCreationWithLabelValues registers node group creation with the provided labels
func RegisterNodeGroupCreationWithLabelValues(groupType string) {
nodeGroupCreationCount.WithLabelValues(groupType).Add(1.0)
}

// RegisterNodeGroupDeletion registers node group deletion
func RegisterNodeGroupDeletion() {
nodeGroupDeletionCount.Add(1.0)
RegisterNodeGroupDeletionWithLabelValues("")
}

// RegisterNodeGroupDeletionWithLabelValues registers node group deletion with the provided labels
func RegisterNodeGroupDeletionWithLabelValues(groupType string) {
nodeGroupDeletionCount.WithLabelValues(groupType).Add(1.0)
}

// UpdateScaleDownInCooldown registers if the cluster autoscaler
Expand Down
Loading