Skip to content

Commit

Permalink
chore: Add pod scheduled prometheus label (#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 24, 2024
1 parent 330b98b commit 63a72bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/metrics/pod/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const (
podHostCapacityType = "capacity_type"
podHostInstanceType = "instance_type"
podPhase = "phase"
podScheduled = "scheduled"
)

var (
Expand Down Expand Up @@ -182,6 +183,7 @@ func labelNames() []string {
podNamespace,
ownerSelfLink,
podHostName,
podScheduled,
podNodePool,
podHostZone,
podHostArchitecture,
Expand Down Expand Up @@ -383,6 +385,7 @@ func (c *Controller) makeLabels(ctx context.Context, pod *corev1.Pod) (prometheu
}
metricLabels[ownerSelfLink] = selflink
metricLabels[podHostName] = pod.Spec.NodeName
metricLabels[podScheduled] = lo.Ternary(pod.Spec.NodeName != "", "true", "false")
metricLabels[podPhase] = string(pod.Status.Phase)

node := &corev1.Node{}
Expand Down

0 comments on commit 63a72bf

Please sign in to comment.